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