diff --git a/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java b/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java index ecd0d961a1..840cab45e8 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java @@ -1,9 +1,16 @@ package com.fr.design.actions.server; import com.fr.base.BaseUtils; +import com.fr.config.ServerPreferenceConfig; +import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; +import com.fr.design.dialog.UIDialog; +import com.fr.design.extra.ShopDialog; import com.fr.design.extra.WebViewDlgHelper; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.MenuKeySet; +import com.fr.design.upm.UPMPane; +import com.fr.general.IOUtils; import javax.swing.*; @@ -20,12 +27,20 @@ public class PluginManagerAction extends UpdateAction { this.setMenuKeySet(PLUGIN_MANAGER); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/server/plugin.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/server/plugin.png")); } @Override public void actionPerformed(ActionEvent e) { - WebViewDlgHelper.createPluginDialog(); + // 可以启用新版本的插件商店(使用JxBrowser作为容器) + if (DesignerEnvManager.getEnvManager().isOpenDebug() + ||ServerPreferenceConfig.getInstance().isUseOptimizedUPM()) { + UPMPane upmPane = new UPMPane(); + UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), upmPane); + dlg.setVisible(true); + } else { + WebViewDlgHelper.createPluginDialog(); + } } public static final MenuKeySet PLUGIN_MANAGER = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/upm/UPMPane.java b/designer-base/src/main/java/com/fr/design/upm/UPMPane.java new file mode 100644 index 0000000000..e9d7032256 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/upm/UPMPane.java @@ -0,0 +1,27 @@ +package com.fr.design.upm; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.ui.ModernUIPane; + +import java.awt.*; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2019-04-12 + * Update Plugin Manager容器 + */ +public class UPMPane extends BasicPane { + @Override + protected String title4PopupWindow() { + return "UPM"; + } + + public UPMPane() { + setLayout(new BorderLayout()); + ModernUIPane modernUIPane = new ModernUIPane.Builder() + .withURL("https://market.fanruan.com") + .build(); + add(modernUIPane, BorderLayout.CENTER); + } +}