From a1e10bd799b26e80fe9006817e2ce7c7f0d9e278 Mon Sep 17 00:00:00 2001 From: ju Date: Mon, 8 Jan 2018 16:49:23 +0800 Subject: [PATCH] =?UTF-8?q?DEC-472=20=E6=96=B0=E6=A8=A1=E5=9D=97=E5=88=92?= =?UTF-8?q?=E5=88=86=E4=B8=8E=E5=90=AF=E5=8A=A8=E3=80=81=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E6=A1=86=E6=9E=B6=20=E4=BF=AE=E6=94=B9=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E6=97=B6=E5=88=B0=E6=96=B0Module?= =?UTF-8?q?=E5=BD=A2=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/start/Designer.java | 23 +-- designer/src/com/fr/start/Designer4BI.java | 86 --------- .../src/com/fr/start/ReportSplashPane.java | 14 +- .../fr/start/module/DesignerEnvActivator.java | 65 +++++++ .../com/fr/start/module/DesignerStartup.java | 101 ++++++++++ .../fr/start/module/PreStartActivator.java | 55 ++++++ .../fr/start/module/StartFinishActivator.java | 38 ++++ .../src/com/fr/start/module/StartupArgs.java | 21 +++ .../fr/start/module/module-designer-env.xml | 6 + .../com/fr/start/module/startup-designer.xml | 10 + .../src/com/fr/start/BaseDesigner.java | 175 +----------------- 11 files changed, 321 insertions(+), 273 deletions(-) delete mode 100644 designer/src/com/fr/start/Designer4BI.java create mode 100644 designer/src/com/fr/start/module/DesignerEnvActivator.java create mode 100644 designer/src/com/fr/start/module/DesignerStartup.java create mode 100644 designer/src/com/fr/start/module/PreStartActivator.java create mode 100644 designer/src/com/fr/start/module/StartFinishActivator.java create mode 100644 designer/src/com/fr/start/module/StartupArgs.java create mode 100644 designer/src/com/fr/start/module/module-designer-env.xml create mode 100644 designer/src/com/fr/start/module/startup-designer.xml diff --git a/designer/src/com/fr/start/Designer.java b/designer/src/com/fr/start/Designer.java index 2f484553a0..79ef4e867d 100644 --- a/designer/src/com/fr/start/Designer.java +++ b/designer/src/com/fr/start/Designer.java @@ -40,18 +40,17 @@ import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; +import com.fr.module.Module; +import com.fr.module.ModuleStartup; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLTools; +import com.fr.start.module.StartupArgs; -import javax.swing.JComponent; -import javax.swing.JPanel; +import javax.swing.*; import javax.swing.border.MatteBorder; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Insets; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -83,7 +82,11 @@ public class Designer extends BaseDesigner { * @param args 参数 */ public static void main(String[] args) { - new Designer(args); + + Module designerRoot = ModuleStartup.parse("/com/fr/start/module/startup-designer.xml"); + //传递启动参数 + designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args)); + designerRoot.start(); } public Designer(String[] args) { @@ -375,12 +378,6 @@ public class Designer extends BaseDesigner { return AlphaFinePane.getAlphaFinePane(); } - - @Override - protected SplashPane createSplashPane() { - return new ReportSplashPane(); - } - /** * 收集用户信息吗 */ diff --git a/designer/src/com/fr/start/Designer4BI.java b/designer/src/com/fr/start/Designer4BI.java deleted file mode 100644 index 312ecd1dab..0000000000 --- a/designer/src/com/fr/start/Designer4BI.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.fr.start; - -import java.util.ArrayList; -import java.util.List; - -import com.fr.base.FRContext; -import com.fr.design.actions.file.newReport.NewWorkBookAction; -import com.fr.design.actions.report.ReportFooterAction; -import com.fr.design.actions.report.ReportHeaderAction; -import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; -import com.fr.design.menu.MenuDef; -import com.fr.design.menu.ShortCut; -import com.fr.general.ComparatorUtils; -import com.fr.stable.Constants; - -/** - * Created with IntelliJ IDEA. - * User: richie - * Date: 12/17/13 - * Time: 12:54 PM - * 这是英文版的GridBI设计器启动类 - */ -public class Designer4BI extends Designer { - - /** - * 启动BI的设计器 - * - * @param args 参数 - * - */ - public static void main(String[] args) { - new Designer4BI(args); - } - - public Designer4BI(String[] args) { - super(args); - } - - protected void initLanguage() { - //这两句的位置不能随便调换,因为会影响语言切换的问题 - FRContext.setLanguage(Constants.LANGUAGE_ENGLISH); - } - - protected SplashPane createSplashPane() { - return new BISplashPane(); - } - - @Override - /** - * 创建新建文件的快捷方式数组。 - * @return 返回快捷方式的数组 - */ - public ShortCut[] createNewFileShortCuts() { - ArrayList shortCuts = new ArrayList(); - shortCuts.add(new NewWorkBookAction()); - return shortCuts.toArray(new ShortCut[shortCuts.size()]); - } - - /** - * 获取模板-菜单选项 - * - * @param plus 当前的工作对象 - * - * @return 菜单栏对象数组 - * - */ - public MenuDef[] createTemplateShortCuts(ToolBarMenuDockPlus plus) { - MenuDef[] menuDefs = plus.menus4Target(); - for (MenuDef m : menuDefs) { - List shortCuts = new ArrayList(); - for (int i = 0, count = m.getShortCutCount(); i < count; i++) { - ShortCut shortCut = m.getShortCut(i); - if (!ComparatorUtils.equals(shortCut.getClass(), ReportHeaderAction.class) - && !ComparatorUtils.equals(shortCut.getClass(), ReportFooterAction.class)) { - shortCuts.add(shortCut); - } - } - m.clearShortCuts(); - for (int i = 0, len = shortCuts.size(); i < len; i ++) { - m.addShortCut(shortCuts.get(i)); - } - - } - return menuDefs; - } -} \ No newline at end of file diff --git a/designer/src/com/fr/start/ReportSplashPane.java b/designer/src/com/fr/start/ReportSplashPane.java index 4ec15fc893..0d80d39fb8 100644 --- a/designer/src/com/fr/start/ReportSplashPane.java +++ b/designer/src/com/fr/start/ReportSplashPane.java @@ -51,6 +51,8 @@ public class ReportSplashPane extends SplashPane { private int loadingIndex = 0; private String[] loading = new String[]{"..", "....", "......"}; private java.util.Timer timer = new java.util.Timer(); + + private ModuleListener listener; private static float uiScale(float f) { return f * JBUI_INIT_SCALE; @@ -74,8 +76,8 @@ public class ReportSplashPane extends SplashPane { ReportSplashPane.this.repaint(); } }, 0, 300); - - ModuleListener moduleListener = new ModuleAdapter() { + + listener = new ModuleAdapter() { @Override public void onStartBefore(String moduleName, String moduleI18nName) { moduleID = moduleI18nName; @@ -84,9 +86,13 @@ public class ReportSplashPane extends SplashPane { ReportSplashPane.this.repaint(); } }; - ModuleContext.registerModuleListener(moduleListener); } - + + public ModuleListener getModuleListener() { + + return listener; + } + protected void paintComponent(Graphics g) { Icon icon = IconLoader.getIcon(StableUtils.pathJoin(OEM_PATH, getImageName())); icon.paintIcon(null, g, 0, 0); diff --git a/designer/src/com/fr/start/module/DesignerEnvActivator.java b/designer/src/com/fr/start/module/DesignerEnvActivator.java new file mode 100644 index 0000000000..5fdf003533 --- /dev/null +++ b/designer/src/com/fr/start/module/DesignerEnvActivator.java @@ -0,0 +1,65 @@ +package com.fr.start.module; + +import com.fr.base.FRContext; +import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.TemplatePane; +import com.fr.design.module.DesignerModule; +import com.fr.env.SignIn; +import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; +import com.fr.general.ModuleContext; +import com.fr.module.Activator; +import com.fr.stable.module.ModuleListener; +import com.fr.start.StartServer; + +/** + * Created by juhaoyu on 2018/1/8. + * 设计器启动时的环境相关模块activator + */ +public class DesignerEnvActivator extends Activator { + + @Override + public void start() { + + String[] args = getModule().findSingleton(StartupArgs.class).get(); + if (args != null) { + for (String arg : args) { + if (ComparatorUtils.equals(arg, "demo")) { + DesignerEnvManager.getEnvManager().setCurrentEnv2Default(); + StartServer.browserDemoURL(); + break; + } + } + } + //设置好环境即可,具体跟环境有关的模块会自动调用 + switch2LastEnv(); + //启动core部分 + getSub("core").start(); + //启动其他模块 + //todo 也切换到新Module + ModuleContext.registerModuleListener(getModule().findSingleton(ModuleListener.class)); + ModuleContext.startModule(DesignerModule.class.getName()); + switch2LastEnv(); + + } + + + private void switch2LastEnv() { + + try { + String current = DesignerEnvManager.getEnvManager().getCurEnvName(); + SignIn.signIn(DesignerEnvManager.getEnvManager().getEnv(current)); + if (!FRContext.getCurrentEnv().testServerConnectionWithOutShowMessagePane()) { + throw new Exception(Inter.getLocText("Datasource-Connection_failed")); + } + } catch (Exception e) { + TemplatePane.getInstance().dealEvnExceptionWhenStartDesigner(); + } + } + + + @Override + public void stop() { + //清空模块 + } +} diff --git a/designer/src/com/fr/start/module/DesignerStartup.java b/designer/src/com/fr/start/module/DesignerStartup.java new file mode 100644 index 0000000000..afff315c7d --- /dev/null +++ b/designer/src/com/fr/start/module/DesignerStartup.java @@ -0,0 +1,101 @@ +package com.fr.start.module; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.utils.DesignUtils; +import com.fr.general.ComparatorUtils; +import com.fr.module.Activator; +import com.fr.stable.ProductConstants; +import com.fr.stable.module.ModuleListener; +import com.fr.start.Designer; +import com.fr.start.ReportSplashPane; +import com.fr.start.SplashWindow; +import com.fr.startup.activators.BasicActivator; + +import java.io.File; + +/** + * Created by juhaoyu on 2018/1/8. + */ +public class DesignerStartup extends Activator { + + private static final int MESSAGE_PORT = 51462; + + private static final int DEBUG_PORT = 51463; + + @Override + public void start() { + + startSub(PreStartActivator.class); + + if (checkMultiStart()) { + return; + } + //启动基础部分 + startSub(BasicActivator.class); + //启动画面 + SplashWindow splashWindow = createSplashWindow(); + //启动env + startSub(DesignerEnvActivator.class); + //启动设计器界面 + startDesigner(); + //启动画面结束 + splashWindow.setVisible(false); + splashWindow.dispose(); + startSub(StartFinishActivator.class); + } + + private SplashWindow createSplashWindow() { + + ReportSplashPane reportSplashPane = new ReportSplashPane(); + SplashWindow splashWindow = new SplashWindow(reportSplashPane); + getModule().setSingleton(ModuleListener.class, reportSplashPane.getModuleListener()); + return splashWindow; + } + + + private void startDesigner() { + + new Designer(getModule().getSingleton(StartupArgs.class).get()); + } + + private boolean checkMultiStart() { + + if (isDebug()) { + setDebugEnv(); + } else { + DesignUtils.setPort(getStartPort()); + } + // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 + if (DesignUtils.isStarted()) { + DesignUtils.clientSend(getModule().findSingleton(StartupArgs.class).get()); + return true; + } + return false; + } + + private int getStartPort() { + + return MESSAGE_PORT; + } + + + //在VM options里加入-Ddebug=true激活 + private boolean isDebug() { + + return ComparatorUtils.equals("true", System.getProperty("debug")); + } + + + //端口改一下,环境配置文件改一下。便于启动两个设计器,进行对比调试 + private void setDebugEnv() { + + DesignUtils.setPort(DEBUG_PORT); + DesignerEnvManager.setEnvFile(new File(ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "Env_debug.xml")); + } + + + @Override + public void stop() { + + } +} diff --git a/designer/src/com/fr/start/module/PreStartActivator.java b/designer/src/com/fr/start/module/PreStartActivator.java new file mode 100644 index 0000000000..75ba423e36 --- /dev/null +++ b/designer/src/com/fr/start/module/PreStartActivator.java @@ -0,0 +1,55 @@ +package com.fr.start.module; + +import com.fr.base.ConfigManagerCreatorProxy; +import com.fr.base.ConfigManagerFactory; +import com.fr.base.FRContext; +import com.fr.design.DesignerEnvManager; +import com.fr.design.RestartHelper; +import com.fr.design.module.DesignModule; +import com.fr.general.GeneralContext; +import com.fr.general.Inter; +import com.fr.general.SiteCenter; +import com.fr.module.Activator; +import com.fr.plugin.conversion.PluginConversionModule; +import com.fr.stable.BuildContext; + +/** + * Created by juhaoyu on 2018/1/8. + */ +public class PreStartActivator extends Activator { + + @Override + public void start() { + + RestartHelper.deleteRecordFilesWhenStart(); + ConfigManagerFactory.registerConfigManagerProxy(new ConfigManagerCreatorProxy()); + BuildContext.setBuildFilePath(buildPropertiesPath()); + SiteCenter.getInstance(); + //标记一下是设计器启动 + PluginConversionModule.getInstance().markDesignerStart(); + initLanguage(); + + // 在 initLanguage 之后加载设计器国际化文件,确保是正确的语言环境 + Inter.loadLocaleFile(GeneralContext.getLocale(), DesignModule.LOCALE_FILE_PATH); + } + + private void initLanguage() { + //这两句的位置不能随便调换,因为会影响语言切换的问题 + FRContext.setLanguage(DesignerEnvManager.getEnvManager(false).getLanguage()); + DesignerEnvManager.checkNameEnvMap(); + } + + + /** + * build得路径 + */ + private String buildPropertiesPath() { + + return "/com/fr/stable/build.properties"; + } + + @Override + public void stop() { + + } +} diff --git a/designer/src/com/fr/start/module/StartFinishActivator.java b/designer/src/com/fr/start/module/StartFinishActivator.java new file mode 100644 index 0000000000..f66459729b --- /dev/null +++ b/designer/src/com/fr/start/module/StartFinishActivator.java @@ -0,0 +1,38 @@ +package com.fr.start.module; + +import com.fr.design.fun.impl.GlobalListenerProviderManager; +import com.fr.design.utils.DesignUtils; +import com.fr.general.ModuleContext; +import com.fr.module.Activator; + +/** + * Created by juhaoyu on 2018/1/8. + */ +public class StartFinishActivator extends Activator { + + private static final int MESSAGE_PORT = 51462; + + @Override + public void start() { + + DesignUtils.creatListeningServer(getStartPort(), startFileSuffix()); + ModuleContext.clearModuleListener(); + GlobalListenerProviderManager.getInstance().init(); + } + + private int getStartPort() { + + return MESSAGE_PORT; + } + + + private String[] startFileSuffix() { + + return new String[]{".cpt", ".xls", ".xlsx", ".frm", ".form", ".cht", ".chart"}; + } + + @Override + public void stop() { + + } +} diff --git a/designer/src/com/fr/start/module/StartupArgs.java b/designer/src/com/fr/start/module/StartupArgs.java new file mode 100644 index 0000000000..b957e8d656 --- /dev/null +++ b/designer/src/com/fr/start/module/StartupArgs.java @@ -0,0 +1,21 @@ +package com.fr.start.module; + +/** + * Created by juhaoyu on 2018/1/8. + * 封装启动参数 + */ +public class StartupArgs { + + private final String[] args; + + public StartupArgs(String[] args) { + + this.args = args; + } + + public String[] get() { + + return args; + } +} + diff --git a/designer/src/com/fr/start/module/module-designer-env.xml b/designer/src/com/fr/start/module/module-designer-env.xml new file mode 100644 index 0000000000..b5d70d019d --- /dev/null +++ b/designer/src/com/fr/start/module/module-designer-env.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/designer/src/com/fr/start/module/startup-designer.xml b/designer/src/com/fr/start/module/startup-designer.xml new file mode 100644 index 0000000000..ade6a79b8d --- /dev/null +++ b/designer/src/com/fr/start/module/startup-designer.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index 02f1cc4330..409106486c 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -3,13 +3,9 @@ */ package com.fr.start; -import com.fr.base.ConfigManagerCreatorProxy; -import com.fr.base.ConfigManagerFactory; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.RestartHelper; -import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.TemplateTreePane; @@ -18,7 +14,6 @@ import com.fr.design.fun.impl.GlobalListenerProviderManager; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.TemplatePane; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; -import com.fr.design.module.DesignModule; import com.fr.design.utils.DesignUtils; import com.fr.env.SignIn; import com.fr.file.FILE; @@ -26,25 +21,11 @@ import com.fr.file.FILEFactory; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; -import com.fr.general.GeneralContext; import com.fr.general.Inter; import com.fr.general.ModuleContext; -import com.fr.general.SiteCenter; -import com.fr.plugin.PluginCollector; -import com.fr.plugin.conversion.PluginConversionModule; -import com.fr.plugin.manage.PluginManager; -import com.fr.plugin.manage.PluginStartup; -import com.fr.register.Register; -import com.fr.stable.ArrayUtils; -import com.fr.stable.BuildContext; import com.fr.stable.OperatingSystem; -import com.fr.stable.ProductConstants; -import com.fr.stable.StableUtils; -import javax.swing.*; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; @@ -56,180 +37,34 @@ import java.lang.reflect.Method; public abstract class BaseDesigner extends ToolBarMenuDock { private static final int LOAD_TREE_MAXNUM = 10; - - private static final int MESSAGEPORT = 51462; - - private Timer timer; - + public BaseDesigner(String[] args) { init(args); } private void init(String[] args) { - - RestartHelper.deleteRecordFilesWhenStart(); - ConfigManagerFactory.registerConfigManagerProxy(new ConfigManagerCreatorProxy()); - //启动core - BuildContext.setBuildFilePath(buildPropertiesPath()); - - if (isDebug()) { - setDebugEnv(); - } else { - DesignUtils.setPort(getStartPort()); - } - // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 - if (DesignUtils.isStarted()) { - DesignUtils.clientSend(args); - return; - } - - Register.load(); - //标记一下是设计器启动 - PluginConversionModule.getInstance().markDesignerStart(); - SiteCenter.getInstance(); - - //下面这两句的位置不能随便调换,因为会影响语言切换的问题 - initLanguage(); - - // 在 initLanguage 之后加载设计器国际化文件,确保是正确的语言环境 - Inter.loadLocaleFile(GeneralContext.getLocale(), DesignModule.LOCALE_FILE_PATH); - - SplashWindow splashWindow = new SplashWindow(createSplashPane()); - if (args != null) { - for (String arg : args) { - if (ComparatorUtils.equals(arg, "demo")) { - DesignerEnvManager.getEnvManager().setCurrentEnv2Default(); - StartServer.browserDemoURL(); - break; - } - } - } - initLookAndFeel(args, splashWindow); - } - private void initLookAndFeel(String[] args, SplashWindow splashWindow) { - // 初始化look and feel.这个在预加载之前执行是因为lookAndFeel里的东西,预加载时也要用到 DesignUtils.initLookAndFeel(); - - DesignUtils.creatListeningServer(getStartPort(), startFileSuffix()); - + // 初始化Log Handler DesignerEnvManager.loadLogSetting(); DesignerFrame df = createDesignerFrame(); - - // 默认加载工作目录,用于读取License - switch2LastEnv(); - - initDefaultFont(); - // 必须先初始化Env再去startModule, 不然会导致lic读取不到 - ModuleContext.startModule(module2Start()); - - // 再次加载工作目录,用于读取工作目录下的各种插件 - switch2LastEnv(); - - ModuleContext.clearModuleListener(); + collectUserInformation(); showDesignerFrame(args, df, false); for (int i = 0; !TemplateTreePane.getInstance().getTemplateFileTree().isTemplateShowing() && i < LOAD_TREE_MAXNUM; i++) { TemplateTreePane.getInstance().getTemplateFileTree().refresh(); } - - splashWindow.setVisible(false); - splashWindow.dispose(); - - bindGlobalListener(); - - showErrorPluginsMessage(); } - private void bindGlobalListener() { - - GlobalListenerProviderManager.getInstance().init(); - } + - private void showErrorPluginsMessage() { - if (timer == null) { - timer = new Timer(5000, new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - String[] plugins = PluginCollector.getCollector().getErrorPlugins(); - if (ArrayUtils.isNotEmpty(plugins)) { - String text = StableUtils.join(plugins, ",") + ": " + Inter.getLocText("FR-Designer_Plugin_Should_Update_Please_Contact_Developer"); - 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) { - WebViewDlgHelper.createPluginDialog(); - } - } - timer.stop(); - } - }); - timer.start(); - } - } - - protected String[] startFileSuffix() { - return new String[]{".cpt", ".xls", ".xlsx", ".frm", ".form", ".cht", ".chart"}; - } - - protected DesignerFrame createDesignerFrame() { + private DesignerFrame createDesignerFrame() { return new DesignerFrame(this); } - protected int getStartPort() { - return MESSAGEPORT; - } - - protected void initLanguage() { - //这两句的位置不能随便调换,因为会影响语言切换的问题 - FRContext.setLanguage(DesignerEnvManager.getEnvManager(false).getLanguage()); - DesignerEnvManager.checkNameEnvMap(); - } - - protected void initDefaultFont() { - - } - - /** - * build得路径 - * - * @return build得路径 - */ - public String buildPropertiesPath() { - return "/com/fr/stable/build.properties"; - } - - - protected SplashPane createSplashPane() { - return new SplashPane(); - } - - //在VM options里加入-Ddebug=true激活 - private boolean isDebug() { - - return ComparatorUtils.equals("true", System.getProperty("debug")); - } - - private static final int DEBUG_PORT = 51463; - - //端口改一下,环境配置文件改一下。便于启动两个设计器,进行对比调试 - private void setDebugEnv() { - DesignUtils.setPort(DEBUG_PORT); - DesignerEnvManager.setEnvFile(new File(ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "Env_debug.xml")); - } - - private void switch2LastEnv() { - try { - String current = DesignerEnvManager.getEnvManager().getCurEnvName(); - SignIn.signIn(DesignerEnvManager.getEnvManager().getEnv(current)); - if (!FRContext.getCurrentEnv().testServerConnectionWithOutShowMessagePane()) { - throw new Exception(Inter.getLocText("Datasource-Connection_failed")); - } - } catch (Exception e) { - TemplatePane.getInstance().dealEvnExceptionWhenStartDesigner(); - } - } private void showDesignerFrame(String[] args, final DesignerFrame df, boolean isException) {