|
|
@ -100,43 +100,47 @@ public abstract class BaseDesigner extends ToolBarMenuDock { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
initLookAndFeel(args, splashWindow); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initLookAndFeel(String[] args, SplashWindow splashWindow) { |
|
|
|
|
|
|
|
|
|
|
|
// 初始化look and feel.这个在预加载之前执行是因为lookAndFeel里的东西,预加载时也要用到
|
|
|
|
// 初始化look and feel.这个在预加载之前执行是因为lookAndFeel里的东西,预加载时也要用到
|
|
|
|
DesignUtils.initLookAndFeel(); |
|
|
|
DesignUtils.initLookAndFeel(); |
|
|
|
|
|
|
|
|
|
|
|
DesignUtils.creatListeningServer(getStartPort(), startFileSuffix()); |
|
|
|
DesignUtils.creatListeningServer(getStartPort(), startFileSuffix()); |
|
|
|
|
|
|
|
|
|
|
|
// 初始化Log Handler
|
|
|
|
// 初始化Log Handler
|
|
|
|
DesignerEnvManager.loadLogSetting(); |
|
|
|
DesignerEnvManager.loadLogSetting(); |
|
|
|
DesignerFrame df = createDesignerFrame(); |
|
|
|
DesignerFrame df = createDesignerFrame(); |
|
|
|
|
|
|
|
|
|
|
|
// 默认加载工作目录,用于读取License
|
|
|
|
// 默认加载工作目录,用于读取License
|
|
|
|
switch2LastEnv(); |
|
|
|
switch2LastEnv(); |
|
|
|
|
|
|
|
|
|
|
|
initDefaultFont(); |
|
|
|
initDefaultFont(); |
|
|
|
//PluginManager要在环境切换和模块启动之前初始化
|
|
|
|
//PluginManager要在环境切换和模块启动之前初始化
|
|
|
|
PluginManager.registerEnvListener(); |
|
|
|
PluginManager.registerEnvListener(); |
|
|
|
// 必须先初始化Env再去startModule, 不然会导致lic读取不到
|
|
|
|
// 必须先初始化Env再去startModule, 不然会导致lic读取不到
|
|
|
|
ModuleContext.startModule(module2Start()); |
|
|
|
ModuleContext.startModule(module2Start()); |
|
|
|
|
|
|
|
|
|
|
|
// 再次加载工作目录,用于读取工作目录下的各种插件
|
|
|
|
// 再次加载工作目录,用于读取工作目录下的各种插件
|
|
|
|
switch2LastEnv(); |
|
|
|
switch2LastEnv(); |
|
|
|
|
|
|
|
|
|
|
|
ModuleContext.clearModuleListener(); |
|
|
|
ModuleContext.clearModuleListener(); |
|
|
|
collectUserInformation(); |
|
|
|
collectUserInformation(); |
|
|
|
showDesignerFrame(args, df, false); |
|
|
|
showDesignerFrame(args, df, false); |
|
|
|
for (int i = 0; !TemplateTreePane.getInstance().getTemplateFileTree().isTemplateShowing() && i < LOAD_TREE_MAXNUM; i++) { |
|
|
|
for (int i = 0; !TemplateTreePane.getInstance().getTemplateFileTree().isTemplateShowing() && i < LOAD_TREE_MAXNUM; i++) { |
|
|
|
TemplateTreePane.getInstance().getTemplateFileTree().refresh(); |
|
|
|
TemplateTreePane.getInstance().getTemplateFileTree().refresh(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
splashWindow.setVisible(false); |
|
|
|
splashWindow.setVisible(false); |
|
|
|
splashWindow.dispose(); |
|
|
|
splashWindow.dispose(); |
|
|
|
|
|
|
|
|
|
|
|
bindGlobalListener(); |
|
|
|
bindGlobalListener(); |
|
|
|
|
|
|
|
|
|
|
|
showErrorPluginsMessage(); |
|
|
|
showErrorPluginsMessage(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void bindGlobalListener() { |
|
|
|
private void bindGlobalListener() { |
|
|
|
|
|
|
|
|
|
|
|
GlobalListenerProviderManager.getInstance().init(); |
|
|
|
GlobalListenerProviderManager.getInstance().init(); |
|
|
@ -251,32 +255,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { |
|
|
|
file = FILEFactory.createFILE(FILEFactory.ENV_PREFIX |
|
|
|
file = FILEFactory.createFILE(FILEFactory.ENV_PREFIX |
|
|
|
+ DesignerEnvManager.getEnvManager().getLastOpenFile()); |
|
|
|
+ DesignerEnvManager.getEnvManager().getLastOpenFile()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
isException = openFile(df, isException, file); |
|
|
|
//启动时打开指定文件的接口
|
|
|
|
|
|
|
|
DesignerStartOpenFileProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerStartOpenFileProcessor.XML_TAG); |
|
|
|
|
|
|
|
if (processor != null) { |
|
|
|
|
|
|
|
FILE f = processor.fileToShow(); |
|
|
|
|
|
|
|
if (f != null) { |
|
|
|
|
|
|
|
file = f;//避免null
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
isException = true;//此时有文件nullpointer异常,执行打开空文件
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (file.exists() && !isException) { |
|
|
|
|
|
|
|
df.openTemplate(file); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
df.addAndActivateJTemplate(); |
|
|
|
|
|
|
|
MutilTempalteTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (OperatingSystem.isMacOS()) { |
|
|
|
|
|
|
|
enableFullScreenMode(df); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
df.addWindowListener(new WindowAdapter() { |
|
|
|
|
|
|
|
public void windowOpened(WindowEvent e) { |
|
|
|
|
|
|
|
df.getSelectedJTemplate().requestGridFocus(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
df.setVisible(true); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
FRLogger.getLogger().error(e.getMessage(), e); |
|
|
|
FRLogger.getLogger().error(e.getMessage(), e); |
|
|
|
if (!isException) { |
|
|
|
if (!isException) { |
|
|
@ -286,8 +265,38 @@ public abstract class BaseDesigner extends ToolBarMenuDock { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean openFile(final DesignerFrame df, boolean isException, FILE file) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//启动时打开指定文件的接口
|
|
|
|
|
|
|
|
DesignerStartOpenFileProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerStartOpenFileProcessor.XML_TAG); |
|
|
|
|
|
|
|
if (processor != null) { |
|
|
|
|
|
|
|
FILE f = processor.fileToShow(); |
|
|
|
|
|
|
|
if (f != null) { |
|
|
|
|
|
|
|
file = f;//避免null
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
isException = true;//此时有文件nullpointer异常,执行打开空文件
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (file.exists() && !isException) { |
|
|
|
|
|
|
|
df.openTemplate(file); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
df.addAndActivateJTemplate(); |
|
|
|
|
|
|
|
MutilTempalteTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (OperatingSystem.isMacOS()) { |
|
|
|
|
|
|
|
enableFullScreenMode(df); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
df.addWindowListener(new WindowAdapter() { |
|
|
|
|
|
|
|
public void windowOpened(WindowEvent e) { |
|
|
|
|
|
|
|
df.getSelectedJTemplate().requestGridFocus(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
df.setVisible(true); |
|
|
|
|
|
|
|
return isException; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @param window |
|
|
|
* @param window |
|
|
|
*/ |
|
|
|
*/ |
|
|
|