@ -129,6 +129,11 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
private volatile boolean opening = false ;
private volatile boolean openFailed = false ;
/ * *
* UI界面模板运行时唯一的id 不存储在模板中 仅在运行时使用 模板界面上关闭就不关注了
* /
private final String runtimeId = UUID . randomUUID ( ) . toString ( ) ;
private PluginEventListener pluginListener ;
public JTemplate ( ) {
@ -1492,10 +1497,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
editingFILE = fileChooser . getSelectedFILE ( ) ;
}
//收集和生成templateID 因为是另存为操作 无论怎么样都需要重新生成templateID
// TODO Hades https://work.fineres.com/browse/REPORT-52936
// initForCollect();
FILE finalEditingFILE = editingFILE ;
CallbackSaveWorker worker = new CallbackSaveWorker ( new Callable < Boolean > ( ) {
@Override
@ -1587,13 +1588,13 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
@Override
public void saveDirectly ( ) {
CallbackSaveWorker worker = save ( ) ;
worker . start ( this . template . getTemplateID ( ) ) ;
worker . start ( getRuntimeId ( ) ) ;
}
@Override
public void saveAsDirectly ( ) {
CallbackSaveWorker worker = saveAs ( ) ;
worker . start ( this . template . getTemplateID ( ) ) ;
worker . start ( getRuntimeId ( ) ) ;
}
@Override
@ -1634,4 +1635,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
return ! isSaving ( ) & & ! isOpening ( ) & & ! isOpenFailed ( ) ;
}
public String getRuntimeId ( ) {
return runtimeId ;
}
}