From 5e68b887b18fabaff35843288b465a61098b2286 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 30 Nov 2016 19:34:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=B8=8B=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../freeze/RepeatAndFreezeSettingPane.java | 4 ++-- .../actions/server/PluginManagerAction.java | 4 ++-- .../{WebDialogFactory.java => WebDialog.java} | 17 ++++++----------- .../src/com/fr/start/BaseDesigner.java | 4 ++-- 4 files changed, 12 insertions(+), 17 deletions(-) rename designer_base/src/com/fr/design/extra/{WebDialogFactory.java => WebDialog.java} (94%) diff --git a/designer/src/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer/src/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 5591fa0db4..8e70675eee 100644 --- a/designer/src/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer/src/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -9,7 +9,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import com.fr.design.dialog.BasicPane; -import com.fr.design.extra.WebDialogFactory; +import com.fr.design.extra.WebDialog; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; @@ -547,7 +547,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { public void actionPerformed(ActionEvent e) { try { //Desktop.getDesktop().browse(new URI(url)); - new WebDialogFactory().createPluginDialog(); + WebDialog.createPluginDialog(); RepeatAndFreezeSettingPane.this.getTopLevelAncestor().setVisible(false); } catch (Exception exp) { diff --git a/designer_base/src/com/fr/design/actions/server/PluginManagerAction.java b/designer_base/src/com/fr/design/actions/server/PluginManagerAction.java index 77a1ae9a86..08dc91b07e 100644 --- a/designer_base/src/com/fr/design/actions/server/PluginManagerAction.java +++ b/designer_base/src/com/fr/design/actions/server/PluginManagerAction.java @@ -2,7 +2,7 @@ package com.fr.design.actions.server; import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; -import com.fr.design.extra.WebDialogFactory; +import com.fr.design.extra.WebDialog; import com.fr.design.menu.MenuKeySet; import com.fr.general.Inter; @@ -25,7 +25,7 @@ public class PluginManagerAction extends UpdateAction { @Override public void actionPerformed(ActionEvent e) { - new WebDialogFactory().createPluginDialog(); + WebDialog.createPluginDialog(); } public static final MenuKeySet PLUGIN_MANAGER = new MenuKeySet() { diff --git a/designer_base/src/com/fr/design/extra/WebDialogFactory.java b/designer_base/src/com/fr/design/extra/WebDialog.java similarity index 94% rename from designer_base/src/com/fr/design/extra/WebDialogFactory.java rename to designer_base/src/com/fr/design/extra/WebDialog.java index ca472c778d..ed7d735631 100644 --- a/designer_base/src/com/fr/design/extra/WebDialogFactory.java +++ b/designer_base/src/com/fr/design/extra/WebDialog.java @@ -24,18 +24,13 @@ import java.util.concurrent.ExecutionException; /** * Created by vito on 2016/9/28. */ -public class WebDialogFactory { +public class WebDialog { private static final String LATEST = "latest"; private static final String SHOP_SCRIPTS = "shop_scripts"; private static final int VERSION_8 = 8; + private static String installHome = StableUtils.getInstallHome(); - private String installHome; - - public WebDialogFactory() { - this.installHome = StableUtils.getInstallHome(); - } - - public void createPluginDialog() { + public static void createPluginDialog() { UIDialog dlg; if (StableUtils.getMajorJavaVersion() >= VERSION_8) { String relativePath = "/scripts/store/web/index.html"; @@ -84,7 +79,7 @@ public class WebDialogFactory { } - private Component initTraditionalStore() { + private static Component initTraditionalStore() { UITabbedPane tabbedPane = new UITabbedPane(); PluginInstalledPane installedPane = new PluginInstalledPane(); tabbedPane.addTab(installedPane.tabTitle(), installedPane); @@ -93,7 +88,7 @@ public class WebDialogFactory { return tabbedPane; } - private void downloadShopScripts(final String scriptsId) { + private static void downloadShopScripts(final String scriptsId) { new SwingWorker() { @Override protected Boolean doInBackground() throws Exception { @@ -143,7 +138,7 @@ public class WebDialogFactory { }.execute(); } - private void updateShopScripts(final String scriptsId) { + private static void updateShopScripts(final String scriptsId) { new SwingWorker() { @Override protected Void doInBackground() throws Exception { diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index 3d9280965c..5af9856c28 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -7,7 +7,7 @@ import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.RestartHelper; -import com.fr.design.extra.WebDialogFactory; +import com.fr.design.extra.WebDialog; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.TemplateTreePane; @@ -126,7 +126,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { String text = StableUtils.join(plugins, ",") + Inter.getLocText("FR-Designer_Plugin_Should_Update"); int r = JOptionPane.showConfirmDialog(null, text, Inter.getLocText("FR-Designer_Plugin_Should_Update_Title"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if (r == JOptionPane.OK_OPTION) { - new WebDialogFactory().createPluginDialog(); + WebDialog.createPluginDialog(); } } timer.stop();