|
|
@ -169,6 +169,19 @@ public abstract class BaseDesigner extends ToolBarMenuDock { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void openTemplate0(DesignerFrame df, AtomicBoolean isException, FILE file) { |
|
|
|
private void openTemplate0(DesignerFrame df, AtomicBoolean isException, FILE file) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
file = getExtraFILE(isException, file); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (file != null && file.exists() && !isException.get()) { |
|
|
|
|
|
|
|
df.openTemplate(file); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
df.addAndActivateJTemplate(); |
|
|
|
|
|
|
|
// 如果没有模板,则需要确认一下
|
|
|
|
|
|
|
|
MutilTempalteTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private FILE getExtraFILE(AtomicBoolean isException, FILE file) { |
|
|
|
|
|
|
|
|
|
|
|
//启动时打开指定文件的接口
|
|
|
|
//启动时打开指定文件的接口
|
|
|
|
DesignerStartOpenFileProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerStartOpenFileProcessor.XML_TAG); |
|
|
|
DesignerStartOpenFileProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerStartOpenFileProcessor.XML_TAG); |
|
|
@ -184,14 +197,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { |
|
|
|
isException.set(true);//此时有文件nullpointer异常,执行打开空文件
|
|
|
|
isException.set(true);//此时有文件nullpointer异常,执行打开空文件
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return file; |
|
|
|
if (file != null && file.exists() && !isException.get()) { |
|
|
|
|
|
|
|
df.openTemplate(file); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
df.addAndActivateJTemplate(); |
|
|
|
|
|
|
|
// 如果没有模板,则需要确认一下
|
|
|
|
|
|
|
|
MutilTempalteTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean openTemplateOnStartup(DesignerFrame df, AtomicBoolean isException, FILE file) { |
|
|
|
private boolean openTemplateOnStartup(DesignerFrame df, AtomicBoolean isException, FILE file) { |
|
|
@ -200,25 +206,40 @@ public abstract class BaseDesigner extends ToolBarMenuDock { |
|
|
|
if (onStartup) { |
|
|
|
if (onStartup) { |
|
|
|
DesignerStartupContext context = DesignerStartupContext.getInstance(); |
|
|
|
DesignerStartupContext context = DesignerStartupContext.getInstance(); |
|
|
|
if (context.isCreateNew()) { |
|
|
|
if (context.isCreateNew()) { |
|
|
|
df.addAndActivateJTemplate(); |
|
|
|
return createNewTemplate(df); |
|
|
|
// 如果没有模板,则需要确认一下
|
|
|
|
|
|
|
|
MutilTempalteTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (context.isOpenLastFile()) { |
|
|
|
if (isOpenTemplate(isException, file, context)) { |
|
|
|
if (file != null && file.exists() && !isException.get()) { |
|
|
|
return openTemplate(df, file); |
|
|
|
df.openTemplate(file); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (context.isOpenEmpty()) { |
|
|
|
if (context.isOpenEmpty()) { |
|
|
|
df.showEmptyJTemplate(); |
|
|
|
return openEmpty(df); |
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean isOpenTemplate(AtomicBoolean isException, FILE file, DesignerStartupContext context) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return context.isOpenLastFile() && file != null && file.exists() && !isException.get(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean openEmpty(DesignerFrame df) { |
|
|
|
|
|
|
|
df.showEmptyJTemplate(); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean openTemplate(DesignerFrame df, FILE file) { |
|
|
|
|
|
|
|
df.openTemplate(file); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean createNewTemplate(DesignerFrame df) { |
|
|
|
|
|
|
|
df.addAndActivateJTemplate(); |
|
|
|
|
|
|
|
// 如果没有模板,则需要确认一下
|
|
|
|
|
|
|
|
MutilTempalteTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void enableFullScreenMode(Window window) { |
|
|
|
private void enableFullScreenMode(Window window) { |
|
|
|
String className = "com.apple.eawt.FullScreenUtilities"; |
|
|
|
String className = "com.apple.eawt.FullScreenUtilities"; |
|
|
|
String methodName = "setWindowCanFullScreen"; |
|
|
|
String methodName = "setWindowCanFullScreen"; |
|
|
|