@ -370,6 +370,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
* /
public void load ( ) {
FineLoggerFactory . getLogger ( ) . info ( "Env Change Template Loading..." ) ;
JTemplate currentTemplate = null ;
if ( stashFILEMap ! = null & & stashFILEMap . size ( ) ! = 0 ) {
int size = historyList . size ( ) ;
for ( int i = 0 ; i < size ; i + + ) {
@ -385,20 +386,24 @@ public class HistoryTemplateListCache implements CallbackEvent {
historyList . set ( i , template ) ;
// 替换当前正在编辑的模板,使用添加并激活的方式,以便使用统一的入口来处理监听事件
if ( isCurrentEditingFile ( template . getPath ( ) ) ) {
loadCurrentTemplate ( template ) ;
currentTemplate = template ;
}
} else {
// 当模板为空时 说明是一个新建的未保存模板 但是内存中保存了该模板 可以从中获取
JTemplate jt = historyList . get ( i ) ;
// 另外如果该模板是正在编辑的模板,需要要激活
if ( jt ! = null & & isCurrentEditingFile ( jt . getPath ( ) ) ) {
loadCurrentTemplate ( jt ) ;
currentTemplate = jt ;
}
}
} catch ( Exception e ) {
FineLoggerFactory . getLogger ( ) . error ( e . getMessage ( ) , e ) ;
}
}
// 最后加载当前正在编辑的模板 以保证数据集刷新正常
if ( currentTemplate ! = null ) {
loadCurrentTemplate ( currentTemplate ) ;
}
stashFILEMap . clear ( ) ;
MutilTempalteTabPane . getInstance ( ) . refreshOpenedTemplate ( historyList ) ;
MutilTempalteTabPane . getInstance ( ) . repaint ( ) ;