From e574304306f716d124c9de31501d82d5ce75f15d Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 1 Jun 2017 10:24:41 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-2354=20=E5=B0=86=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=9A=84=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E5=92=8C=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E7=9A=84=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=B5=B7=E6=9D=A5(=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E5=85=88=E4=BC=A0=EF=BC=8C=E7=94=A8=E6=9D=A5=E8=B0=83=E8=AF=95?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/extra/PluginWebBridge.java | 10 ++++ .../com/fr/design/extra/WebViewDlgHelper.java | 49 ++++++++++--------- .../extra/exe/callback/DownloadCallback.java | 4 +- .../exe/callback/InstallFromDiskCallback.java | 4 +- .../extratask/AbstractExtraPluginTask.java | 1 - 5 files changed, 39 insertions(+), 29 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/PluginWebBridge.java b/designer_base/src/com/fr/design/extra/PluginWebBridge.java index 5c8a45587b..be0d9a3ba5 100644 --- a/designer_base/src/com/fr/design/extra/PluginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/PluginWebBridge.java @@ -508,4 +508,14 @@ public class PluginWebBridge { DesignerEnvManager.getEnvManager().setInShowBBsName(StringUtils.EMPTY); uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn")); } + public void initExtraDiff(final JSObject callback){ + + } + public void showLoginContent(){ + + } + public boolean isDesigner(){ + return true; + } + } diff --git a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java index 8bb7cfc571..bccc259f2d 100644 --- a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java @@ -33,20 +33,20 @@ public class WebViewDlgHelper { public static void createPluginDialog() { if (StableUtils.getMajorJavaVersion() >= VERSION_8) { - String relativePath = "/scripts/store/web/index.html"; - String mainJsPath = StableUtils.pathJoin(new File(installHome).getAbsolutePath(), relativePath); + String relativePath = "index.html"; + String mainJsPath = StableUtils.pathJoin(FRContext.getCurrentEnv().getWebReportPath(), relativePath); File file = new File(mainJsPath); 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(SHOP_SCRIPTS); - } +// 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(SHOP_SCRIPTS); +// } } else { updateShopScripts(SHOP_SCRIPTS); showPluginDlg(mainJsPath); @@ -111,7 +111,7 @@ public class WebViewDlgHelper { } private static void showLoginDlg() { - LoginWebPane webPane = new LoginWebPane(new File(installHome).getAbsolutePath()); + LoginWebPane webPane = new LoginWebPane(FRContext.getCurrentEnv().getWebReportPath()); UIDialog qqdlg = new LoginDialog(DesignerContext.getDesignerFrame(), webPane); LoginWebBridge.getHelper().setDialogHandle(qqdlg); qqdlg.setVisible(true); @@ -153,7 +153,8 @@ public class WebViewDlgHelper { try { if (get()) { - IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), StableUtils.getInstallHome()); + IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), FRContext.getCurrentEnv().getWebReportPath()); + // TODO: 2017/4/17 删除之前存放在安装目录下的script int rv = JOptionPane.showOptionDialog( null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), @@ -184,16 +185,16 @@ public class WebViewDlgHelper { if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { String text = httpClient.getResponseText(); if (!ComparatorUtils.equals(text, LATEST)) { - int rv = JOptionPane.showConfirmDialog( - null, - Inter.getLocText("FR-Designer-Plugin_Shop_Need_Update"), - Inter.getLocText("FR-Designer-Plugin_Warning"), - JOptionPane.OK_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE - ); - if (rv == JOptionPane.OK_OPTION) { - downloadShopScripts(scriptsId); - } +// int rv = JOptionPane.showConfirmDialog( +// null, +// Inter.getLocText("FR-Designer-Plugin_Shop_Need_Update"), +// Inter.getLocText("FR-Designer-Plugin_Warning"), +// JOptionPane.OK_CANCEL_OPTION, +// JOptionPane.INFORMATION_MESSAGE +// ); +// if (rv == JOptionPane.OK_OPTION) { +// downloadShopScripts(scriptsId); +// } } } return null; diff --git a/designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java index ba4d9b31fc..93ea0fe224 100644 --- a/designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java +++ b/designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java @@ -11,9 +11,9 @@ import javax.swing.*; */ public class DownloadCallback extends AbstractPluginTaskCallback { private ExtraPluginTask extraPluginTask; - protected JSCallback jsCallback; + private JSCallback jsCallback; - public DownloadCallback(ExtraPluginTask extraPluginTask, JSCallback jsCallback) { + public DownloadCallback(final ExtraPluginTask extraPluginTask, final JSCallback jsCallback) { this.extraPluginTask = extraPluginTask; this.jsCallback = jsCallback; } diff --git a/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index cf13dd0a54..aa74e9c02c 100644 --- a/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java @@ -14,9 +14,9 @@ import java.io.File; */ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { private File zipFile; - protected JSCallback jsCallback; + private JSCallback jsCallback; - public InstallFromDiskCallback(File zipFile, JSCallback jsCallback) { + public InstallFromDiskCallback(final File zipFile, final JSCallback jsCallback) { this.zipFile = zipFile; this.jsCallback = jsCallback; } diff --git a/designer_base/src/com/fr/design/extra/exe/extratask/AbstractExtraPluginTask.java b/designer_base/src/com/fr/design/extra/exe/extratask/AbstractExtraPluginTask.java index 22cd8c826b..a287ca7ed8 100644 --- a/designer_base/src/com/fr/design/extra/exe/extratask/AbstractExtraPluginTask.java +++ b/designer_base/src/com/fr/design/extra/exe/extratask/AbstractExtraPluginTask.java @@ -1,6 +1,5 @@ package com.fr.design.extra.exe.extratask; -import com.fr.design.extra.exe.callback.JSCallback; import com.fr.plugin.context.PluginMarker; /**