From 76fbbef18123c2c548f9e11326fc9cee1e416f1e Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 12 Apr 2019 14:13:42 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-442=20=E9=85=8D=E5=90=88=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=96=B0=E7=89=88=E6=9C=AC=E6=8F=92=E4=BB=B6=E5=95=86?= =?UTF-8?q?=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/server/PluginManagerAction.java | 19 +++++++++++-- .../main/java/com/fr/design/upm/UPMPane.java | 27 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/upm/UPMPane.java 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); + } +}