Browse Source

Merging in latest from upstream (PF/design:refs/heads/9.0)

* commit '100c9bd37e6f27a31c47602324aa05aa98b60835':
  REPORT-2354 将平台的插件管理和设计器的插件管理统一起来(暂时先传,用来调试)
master
ju 8 years ago
parent
commit
588fd729a2
  1. 10
      designer_base/src/com/fr/design/extra/PluginWebBridge.java
  2. 49
      designer_base/src/com/fr/design/extra/WebViewDlgHelper.java
  3. 4
      designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java
  4. 4
      designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  5. 1
      designer_base/src/com/fr/design/extra/exe/extratask/AbstractExtraPluginTask.java

10
designer_base/src/com/fr/design/extra/PluginWebBridge.java

@ -508,4 +508,14 @@ public class PluginWebBridge {
DesignerEnvManager.getEnvManager().setInShowBBsName(StringUtils.EMPTY); DesignerEnvManager.getEnvManager().setInShowBBsName(StringUtils.EMPTY);
uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn")); uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn"));
} }
public void initExtraDiff(final JSObject callback){
}
public void showLoginContent(){
}
public boolean isDesigner(){
return true;
}
} }

49
designer_base/src/com/fr/design/extra/WebViewDlgHelper.java

@ -33,20 +33,20 @@ public class WebViewDlgHelper {
public static void createPluginDialog() { public static void createPluginDialog() {
if (StableUtils.getMajorJavaVersion() >= VERSION_8) { if (StableUtils.getMajorJavaVersion() >= VERSION_8) {
String relativePath = "/scripts/store/web/index.html"; String relativePath = "index.html";
String mainJsPath = StableUtils.pathJoin(new File(installHome).getAbsolutePath(), relativePath); String mainJsPath = StableUtils.pathJoin(FRContext.getCurrentEnv().getWebReportPath(), relativePath);
File file = new File(mainJsPath); File file = new File(mainJsPath);
if (!file.exists()) { if (!file.exists()) {
int rv = JOptionPane.showConfirmDialog( // int rv = JOptionPane.showConfirmDialog(
null, // null,
Inter.getLocText("FR-Designer-Plugin_Shop_Need_Install"), // Inter.getLocText("FR-Designer-Plugin_Shop_Need_Install"),
Inter.getLocText("FR-Designer-Plugin_Warning"), // Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.OK_CANCEL_OPTION, // JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE // JOptionPane.INFORMATION_MESSAGE
); // );
if (rv == JOptionPane.OK_OPTION) { // if (rv == JOptionPane.OK_OPTION) {
downloadShopScripts(SHOP_SCRIPTS); // downloadShopScripts(SHOP_SCRIPTS);
} // }
} else { } else {
updateShopScripts(SHOP_SCRIPTS); updateShopScripts(SHOP_SCRIPTS);
showPluginDlg(mainJsPath); showPluginDlg(mainJsPath);
@ -111,7 +111,7 @@ public class WebViewDlgHelper {
} }
private static void showLoginDlg() { 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); UIDialog qqdlg = new LoginDialog(DesignerContext.getDesignerFrame(), webPane);
LoginWebBridge.getHelper().setDialogHandle(qqdlg); LoginWebBridge.getHelper().setDialogHandle(qqdlg);
qqdlg.setVisible(true); qqdlg.setVisible(true);
@ -153,7 +153,8 @@ public class WebViewDlgHelper {
try { try {
if (get()) { 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( int rv = JOptionPane.showOptionDialog(
null, null,
Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer-Plugin_Shop_Installed"),
@ -184,16 +185,16 @@ public class WebViewDlgHelper {
if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) {
String text = httpClient.getResponseText(); String text = httpClient.getResponseText();
if (!ComparatorUtils.equals(text, LATEST)) { if (!ComparatorUtils.equals(text, LATEST)) {
int rv = JOptionPane.showConfirmDialog( // int rv = JOptionPane.showConfirmDialog(
null, // null,
Inter.getLocText("FR-Designer-Plugin_Shop_Need_Update"), // Inter.getLocText("FR-Designer-Plugin_Shop_Need_Update"),
Inter.getLocText("FR-Designer-Plugin_Warning"), // Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.OK_CANCEL_OPTION, // JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE // JOptionPane.INFORMATION_MESSAGE
); // );
if (rv == JOptionPane.OK_OPTION) { // if (rv == JOptionPane.OK_OPTION) {
downloadShopScripts(scriptsId); // downloadShopScripts(scriptsId);
} // }
} }
} }
return null; return null;

4
designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java

@ -11,9 +11,9 @@ import javax.swing.*;
*/ */
public class DownloadCallback extends AbstractPluginTaskCallback { public class DownloadCallback extends AbstractPluginTaskCallback {
private ExtraPluginTask extraPluginTask; 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.extraPluginTask = extraPluginTask;
this.jsCallback = jsCallback; this.jsCallback = jsCallback;
} }

4
designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -14,9 +14,9 @@ import java.io.File;
*/ */
public class InstallFromDiskCallback extends AbstractPluginTaskCallback { public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
private File zipFile; 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.zipFile = zipFile;
this.jsCallback = jsCallback; this.jsCallback = jsCallback;
} }

1
designer_base/src/com/fr/design/extra/exe/extratask/AbstractExtraPluginTask.java

@ -1,6 +1,5 @@
package com.fr.design.extra.exe.extratask; package com.fr.design.extra.exe.extratask;
import com.fr.design.extra.exe.callback.JSCallback;
import com.fr.plugin.context.PluginMarker; import com.fr.plugin.context.PluginMarker;
/** /**

Loading…
Cancel
Save