You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.9 KiB
58 lines
1.9 KiB
package com.fr.plugin.customexplorer.preview; |
|
|
|
import com.fr.design.fun.impl.AbstractPreviewProvider; |
|
import com.fr.design.i18n.Toolkit; |
|
import com.fr.design.mainframe.JForm; |
|
import com.fr.design.mainframe.JTemplate; |
|
import com.fr.plugin.context.PluginContext; |
|
import com.fr.plugin.context.PluginMarker; |
|
import com.fr.plugin.customexplorer.utils.ExplorerWebPreviewUtils; |
|
import com.fr.plugin.manage.PluginManager; |
|
|
|
import javax.swing.*; |
|
import java.awt.*; |
|
|
|
import static javax.swing.JOptionPane.ERROR_MESSAGE; |
|
|
|
/** |
|
* @author fr.open |
|
* @create 2019/10/8 |
|
* 普通报表,点击运行按钮下面的下拉按钮,弹出预览方式及浏览器选择菜单 |
|
*/ |
|
public class ExplorerSelectPreview extends AbstractPreviewProvider { |
|
@Override |
|
public void onClick(JTemplate<?, ?> jTemplate) { |
|
//PluginContext context = PluginManager.getContext(PluginMarker.create("com.fr.plugin.customexplorer.v10", "1.1")); |
|
PluginContext context = PluginManager.getContext("com.fr.plugin.customexplorer.v10"); |
|
if (null == context || !context.isAvailable() || !context.isRunning()) { |
|
JOptionPane.showMessageDialog((Component)null, Toolkit.i18nText("Explorer_Setting_PluginAvailableErrorTips"), "", ERROR_MESSAGE); |
|
} else { |
|
ExplorerWebPreviewUtils.popupMenu(jTemplate); |
|
} |
|
} |
|
|
|
@Override |
|
public String nameForPopupItem() { |
|
return Toolkit.i18nText("Explorer_Setting_SelectPreviewLabel"); |
|
} |
|
|
|
@Override |
|
public String iconPathForPopupItem() { |
|
return "com/fr/plugin/customexplorer/icon/preview.png"; |
|
} |
|
|
|
@Override |
|
public String iconPathForLarge() { |
|
return "com/fr/plugin/customexplorer/icon/preview32.png"; |
|
} |
|
|
|
@Override |
|
public int previewTypeCode() { |
|
return 10; |
|
} |
|
|
|
@Override |
|
public boolean accept(JTemplate jTemplate) { |
|
return super.accept(jTemplate) || jTemplate instanceof JForm; |
|
} |
|
}
|
|
|