From 011950a2185c9dfff171fdaa84b393525413ef13 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 28 Apr 2016 15:50:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=9C=A8=E9=A1=B5=E9=9D=A2=E8=83=8C=E9=83=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/extra/PluginManagerPane.java | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/PluginManagerPane.java b/designer_base/src/com/fr/design/extra/PluginManagerPane.java index 0704977f6..00c8aca1f 100644 --- a/designer_base/src/com/fr/design/extra/PluginManagerPane.java +++ b/designer_base/src/com/fr/design/extra/PluginManagerPane.java @@ -12,6 +12,8 @@ import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.plugin.PluginVerifyException; import com.fr.stable.StableUtils; +import com.fr.third.org.apache.poi.hssf.record.formula.functions.T; +import org.easymock.internal.matchers.Null; import javax.swing.*; import java.awt.*; @@ -43,22 +45,22 @@ public class PluginManagerPane extends BasicPane { URL url = ClassLoader.getSystemResource(""); installHome = url.getPath(); } else { - installHome = StableUtils.getInstallHome(); - File file = new File(StableUtils.pathJoin(installHome, "scripts")); - if (!file.exists()) { - int rv = JOptionPane.showConfirmDialog( - null, - Inter.getLocText("FR-Designer-Plugin_Shop_Need_Install"), - Inter.getLocText("FR-Designer-Plugin_Warning"), - JOptionPane.OK_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE - ); - if (rv == JOptionPane.OK_OPTION) { - downloadShopScripts(); + installHome = StableUtils.getInstallHome(); + File file = new File(StableUtils.pathJoin(installHome, "scripts")); + if (!file.exists()) { + int rv = JOptionPane.showConfirmDialog( + this, + Inter.getLocText("FR-Designer-Plugin_Shop_Need_Install"), + Inter.getLocText("FR-Designer-Plugin_Warning"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.INFORMATION_MESSAGE + ); + if (rv == JOptionPane.OK_OPTION) { + downloadShopScripts(); + } + } else { + updateShopScripts(); } - } else { - updateShopScripts(); - } } PluginWebPane webPane = new PluginWebPane(new File(installHome).getAbsolutePath()); add(webPane, BorderLayout.CENTER); @@ -90,7 +92,7 @@ public class PluginManagerPane extends BasicPane { } }); } catch (PluginVerifyException e) { - JOptionPane.showMessageDialog(null, e.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(PluginManagerPane.this, e.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); return false; } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); @@ -106,7 +108,7 @@ public class PluginManagerPane extends BasicPane { if (get()) { IOUtils.unzip(new File(StableUtils.pathJoin(PluginHelper.DOWNLOAD_PATH, PluginHelper.TEMP_FILE)), StableUtils.getInstallHome()); int rv = JOptionPane.showOptionDialog( - null, + PluginManagerPane.this, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.YES_NO_OPTION, @@ -135,7 +137,7 @@ public class PluginManagerPane extends BasicPane { if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { if (!ComparatorUtils.equals(httpClient.getResponseText(), LATEST)) { int rv = JOptionPane.showConfirmDialog( - null, + PluginManagerPane.this, Inter.getLocText("FR-Designer-Plugin_Shop_Need_Update"), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.OK_CANCEL_OPTION, From 3d4efa0a4c0552c686ac0448745cf55bd702f391 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 28 Apr 2016 18:20:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1=E3=80=81=E5=87=8F=E5=B0=8F=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=95=86=E5=BA=97=E7=AA=97=E4=BD=93=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=202=E3=80=81=E6=8F=90=E9=86=92=E6=8F=92=E4=BB=B6=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E7=9A=84=E6=97=B6=E5=80=99=E4=BD=BF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E6=A1=86=E4=BD=93=E6=94=B9=E4=B8=BA=E6=96=B0=E7=89=88=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=95=86=E5=BA=97=E7=9A=84=E6=A1=86=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/extra/PluginShopDialog.java | 2 +- designer_base/src/com/fr/start/BaseDesigner.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/PluginShopDialog.java b/designer_base/src/com/fr/design/extra/PluginShopDialog.java index cc75e46e8..05b192b95 100644 --- a/designer_base/src/com/fr/design/extra/PluginShopDialog.java +++ b/designer_base/src/com/fr/design/extra/PluginShopDialog.java @@ -10,7 +10,7 @@ import java.awt.*; * Created by vito on 16/4/18. */ public class PluginShopDialog extends UIDialog { - private static final Dimension DEFAULT_SHOP = new Dimension(900, 700); + private static final Dimension DEFAULT_SHOP = new Dimension(900, 690); public PluginShopDialog(Frame frame, BasicPane pane) { super(frame, pane, false); diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index df341bc41..6d92b1067 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -7,8 +7,10 @@ import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.RestartHelper; -import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.UIDialog; import com.fr.design.extra.PluginManagerPane; +import com.fr.design.extra.PluginShopDialog; +import com.fr.design.extra.PluginWebBridge; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.TemplateTreePane; @@ -130,7 +132,8 @@ public abstract class BaseDesigner extends ToolBarMenuDock { 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) { final PluginManagerPane managerPane = new PluginManagerPane(); - BasicDialog dlg = managerPane.showLargeWindow(DesignerContext.getDesignerFrame(),null); + UIDialog dlg = new PluginShopDialog(DesignerContext.getDesignerFrame(),managerPane); + PluginWebBridge.getHelper().setDialogHandle(dlg); dlg.setVisible(true); } } From 83a9bdf8dd3688ee3fce8096cf17f6ccb28bc162 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 28 Apr 2016 19:42:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/extra/PluginManagerPane.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/PluginManagerPane.java b/designer_base/src/com/fr/design/extra/PluginManagerPane.java index 00c8aca1f..ae64f58a6 100644 --- a/designer_base/src/com/fr/design/extra/PluginManagerPane.java +++ b/designer_base/src/com/fr/design/extra/PluginManagerPane.java @@ -12,8 +12,6 @@ import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.plugin.PluginVerifyException; import com.fr.stable.StableUtils; -import com.fr.third.org.apache.poi.hssf.record.formula.functions.T; -import org.easymock.internal.matchers.Null; import javax.swing.*; import java.awt.*;