|
|
@ -63,14 +63,15 @@ public abstract class BaseDesigner extends ToolBarMenuDock { |
|
|
|
|
|
|
|
|
|
|
|
public BaseDesigner(String[] args) { |
|
|
|
public BaseDesigner(String[] args) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init(args); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void init(String[] args) { |
|
|
|
|
|
|
|
|
|
|
|
RestartHelper.deleteRecordFilesWhenStart(); |
|
|
|
RestartHelper.deleteRecordFilesWhenStart(); |
|
|
|
ConfigManagerFactory.registerConfigManagerProxy(new ConfigManagerCreatorProxy()); |
|
|
|
ConfigManagerFactory.registerConfigManagerProxy(new ConfigManagerCreatorProxy()); |
|
|
|
//启动core
|
|
|
|
//启动core
|
|
|
|
BuildContext.setBuildFilePath(buildPropertiesPath()); |
|
|
|
BuildContext.setBuildFilePath(buildPropertiesPath()); |
|
|
|
Register.load(); |
|
|
|
|
|
|
|
//标记一下是设计器启动
|
|
|
|
|
|
|
|
PluginConversionModule.getInstance().markDesignerStart(); |
|
|
|
|
|
|
|
SiteCenter.getInstance(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isDebug()) { |
|
|
|
if (isDebug()) { |
|
|
|
setDebugEnv(); |
|
|
|
setDebugEnv(); |
|
|
@ -83,6 +84,11 @@ public abstract class BaseDesigner extends ToolBarMenuDock { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Register.load(); |
|
|
|
|
|
|
|
//标记一下是设计器启动
|
|
|
|
|
|
|
|
PluginConversionModule.getInstance().markDesignerStart(); |
|
|
|
|
|
|
|
SiteCenter.getInstance(); |
|
|
|
|
|
|
|
|
|
|
|
//下面这两句的位置不能随便调换,因为会影响语言切换的问题
|
|
|
|
//下面这两句的位置不能随便调换,因为会影响语言切换的问题
|
|
|
|
initLanguage(); |
|
|
|
initLanguage(); |
|
|
|
|
|
|
|
|
|
|
@ -99,6 +105,10 @@ 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(); |
|
|
@ -199,7 +209,8 @@ public abstract class BaseDesigner extends ToolBarMenuDock { |
|
|
|
|
|
|
|
|
|
|
|
//在VM options里加入-Ddebug=true激活
|
|
|
|
//在VM options里加入-Ddebug=true激活
|
|
|
|
private boolean isDebug() { |
|
|
|
private boolean isDebug() { |
|
|
|
return "true".equals(System.getProperty("debug")); |
|
|
|
|
|
|
|
|
|
|
|
return ComparatorUtils.equals("true", System.getProperty("debug")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final int DEBUG_PORT = 51463; |
|
|
|
private static final int DEBUG_PORT = 51463; |
|
|
@ -250,32 +261,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,6 +272,36 @@ 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 |
|
|
|