Browse Source

Merge pull request #120 in DESIGN/design from ~KERRY/design_10.0:feature/10.0 to feature/10.0

* commit 'b3b68db75f58f2bc3891c75fbbc2e73b468447f1':
  REPORT-8655 【较急】设计器菜单中的400热线更换
  REPORT-8676 插件管理10.0升级
master
kerry 7 years ago
parent
commit
8ef76cc2b7
  1. 4
      designer-base/src/com/fr/design/actions/help/AboutPane.java
  2. 5
      designer-base/src/com/fr/design/extra/PluginWebBridge.java
  3. 37
      designer-base/src/com/fr/design/extra/WebViewDlgHelper.java

4
designer-base/src/com/fr/design/actions/help/AboutPane.java

@ -9,7 +9,6 @@ import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
@ -34,6 +33,7 @@ public class AboutPane extends JPanel {
private static final int DEFAULT_GAP = 12;
private static final String COPYRIGHT_LABEL = "\u00A9 ";
private static final String BUILD_PREFIX = " ";
private static final String COMPANY_TELEPHONE = SiteCenter.getInstance().acquireUrlByKind("company_telephone");
public AboutPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -90,7 +90,7 @@ public class AboutPane extends JPanel {
if (FRContext.getLocale().equals(Locale.US)) {
return;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + SiteCenter.getInstance().acquireUrlByKind("service.phone." + FRContext.getLocale(), ProductConstants.COMPARE_TELEPHONE));
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + SiteCenter.getInstance().acquireUrlByKind("service.phone." + FRContext.getLocale(), COMPANY_TELEPHONE));
contentPane.add(boxCenterAlignmentPane);
// 繁体版不显示QQ
if (FRContext.getLocale().equals(Locale.TAIWAN)) {

5
designer-base/src/com/fr/design/extra/PluginWebBridge.java

@ -559,6 +559,11 @@ public class PluginWebBridge {
uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn"));
}
public void updatePluginStore(final JSObject callback){
JSCallback jsCallback = new JSCallback(webEngine, callback);
jsCallback.execute(StringUtils.EMPTY);
}
/**
* 初始化设计器部分
*/

37
designer-base/src/com/fr/design/extra/WebViewDlgHelper.java

@ -17,7 +17,9 @@ import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginStoreConstants;
import com.fr.plugin.PluginVerifyException;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
@ -44,7 +46,7 @@ public class WebViewDlgHelper {
private static final int VERSION_8 = 8;
private static String installHome = FRContext.getCurrentEnv().getWebReportPath();
private static final String MAIN_JS_PATH = "/scripts/plugin.html";
private static final int BYTES_NUM = 1024;
private static final String ENV_VERSION = "ENV_VERSION";
static {
GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@ -70,10 +72,24 @@ public class WebViewDlgHelper {
if (rv == JOptionPane.OK_OPTION) {
downloadShopScripts(SHOP_SCRIPTS);
}
} else {
showPluginDlg();
}
String jar_version = PluginStoreConstants.getInstance().getProps(ENV_VERSION, StringUtils.EMPTY);
if (ComparatorUtils.equals(jar_version, ProductConstants.VERSION)) {
updateShopScripts(SHOP_SCRIPTS);
} else {
int rv = JOptionPane.showConfirmDialog(
null,
Inter.getLocText("Fine-Plugin_Shop_Need_Install_Version"),
Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE
);
if (rv == JOptionPane.OK_OPTION) {
downloadShopScripts(SHOP_SCRIPTS);
deleteExtraFile(StableUtils.pathJoin(installHome, "plugin.html"));
}
}
} else {
BasicPane traditionalStorePane = new BasicPane() {
@Override
@ -109,6 +125,16 @@ public class WebViewDlgHelper {
}
}
/**
* 删除9.0工程下无用的plugin.html文件
*
* @param filePath 待删除文件路径
*/
private static void deleteExtraFile(String filePath){
CommonIOUtils.deleteFile(new File(filePath));
}
/**
* 以关键词打开设计器商店
*
@ -252,12 +278,10 @@ public class WebViewDlgHelper {
try {
if (get()) {
String relativePath = "/scripts/plugin.html";
IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome);
copyMainFile(StableUtils.pathJoin(installHome, relativePath));
// TODO: 2017/4/17 删除之前存放在安装目录下的script
PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE);
showPluginDlg();
}
} catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -290,6 +314,7 @@ public class WebViewDlgHelper {
}
}
}
showPluginDlg();
return null;
}
}.execute();

Loading…
Cancel
Save