Browse Source

添加国际化

换新的api命名以区分重载防止js调用时冲突
master
vito 9 years ago
parent
commit
cb8e649a27
  1. 11
      designer_base/src/com/fr/design/extra/PluginManagerPane.java
  2. 5
      designer_base/src/com/fr/design/extra/PluginWebBridge.java

11
designer_base/src/com/fr/design/extra/PluginManagerPane.java

@ -32,16 +32,16 @@ public class PluginManagerPane extends BasicPane {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
if (System.getProperty("java.version").startsWith("1.8")) { if (System.getProperty("java.version").startsWith("1.8")) {
String installHome; String installHome;
if(StableUtils.isDebug()){ if (StableUtils.isDebug()) {
URL url = ClassLoader.getSystemResource(""); URL url = ClassLoader.getSystemResource("");
installHome = url.getPath() + "scripts"; installHome = url.getPath() + "scripts";
}else{ } else {
installHome = StableUtils.getInstallHome() + File.separator + "scripts"; installHome = StableUtils.getInstallHome() + File.separator + "scripts";
File file = new File(installHome); File file = new File(installHome);
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_Warning"), Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.OK_CANCEL_OPTION, JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE JOptionPane.INFORMATION_MESSAGE
@ -53,7 +53,6 @@ public class PluginManagerPane extends BasicPane {
} }
PluginWebPane webPane = new PluginWebPane(new File(installHome).getAbsolutePath()); PluginWebPane webPane = new PluginWebPane(new File(installHome).getAbsolutePath());
add(webPane, BorderLayout.CENTER); add(webPane, BorderLayout.CENTER);
} else { } else {
initTraditionalStore(); initTraditionalStore();
} }
@ -92,7 +91,7 @@ public class PluginManagerPane extends BasicPane {
IOUtils.unzip(new File(StableUtils.pathJoin(PluginHelper.DOWNLOAD_PATH, PluginHelper.TEMP_FILE)), StableUtils.getInstallHome()); IOUtils.unzip(new File(StableUtils.pathJoin(PluginHelper.DOWNLOAD_PATH, PluginHelper.TEMP_FILE)), StableUtils.getInstallHome());
int rv = JOptionPane.showOptionDialog( int rv = JOptionPane.showOptionDialog(
null, null,
"商店安装完毕,是否立刻启动?", Inter.getLocText("FR-Designer-Plugin_Shop_Installed"),
Inter.getLocText("FR-Designer-Plugin_Warning"), Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.YES_NO_OPTION, JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE, JOptionPane.INFORMATION_MESSAGE,

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

@ -33,7 +33,7 @@ public class PluginWebBridge {
private UIDialog uiDialog; private UIDialog uiDialog;
public static final String PLUGIN_SHOP = "http://192.168.101.20/ShopServer?pg=plist"; public static final String PLUGIN_SHOP = "http://192.168.101.20/ShopServer?pg=plist";//http://shop.finereport.com/ShopServer?pg=plist(plugin.list)
public static PluginWebBridge getHelper() { public static PluginWebBridge getHelper() {
if (helper != null) { if (helper != null) {
@ -264,10 +264,11 @@ public class PluginWebBridge {
/** /**
* 在本地浏览器里打开url * 在本地浏览器里打开url
* tips:重载的时候,需要给js调用的方法需要放在前面,否则可能不会被调用(此乃坑) * tips:重载的时候,需要给js调用的方法需要放在前面,否则可能不会被调用(此乃坑)
* 所以最好的是不要重载在js可以访问的接口文件中
* *
* @param url 要打开的地址 * @param url 要打开的地址
*/ */
public void openUrlAtLocalWebBrowser(String url) { public void openShopUrlAtWebBrowser(String url) {
openUrlAtLocalWebBrowser(webEngine, url); openUrlAtLocalWebBrowser(webEngine, url);
} }

Loading…
Cancel
Save