@ -268,9 +268,14 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
TemplateTheme usingTheme = getTemplateTheme ( ) ;
boolean isUsingThemeChanged = StringUtils . equals ( event . themName , usingTheme . getName ( ) ) ;
if ( isUsingThemeChanged & & ( event . action = = TemplateThemeConfig . ThemeConfigAction . REMOVE | |
event . action = = TemplateThemeConfig . ThemeConfigAction . UPDATE ) ) {
if ( event . action = = TemplateThemeConfig . ThemeConfigAction . REMOVE | |
event . action = = TemplateThemeConfig . ThemeConfigAction . UPDATE ) {
if ( isUsingThemeChanged ) {
checkAndResetTheme ( ) ;
} else {
// 修改主题配置,但是没有修改主题名称 , 需要重新保存文件
fireSuperTargetModified ( ) ;
}
}
}
} ;
@ -470,6 +475,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/ * *
* 用于 切换工作目录 时的模板资源暂存
*
* @return
* /
public FILE templateToStashFile4Envchange ( ) {
@ -545,6 +551,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/ * *
* 刷新 模板资源 和 EditingFILE
* 仅在切换工作目录 , reload模板时使用
*
* @param file
* /
public void refreshResourceAndEditingFILE ( FILE file ) {
@ -1785,7 +1792,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
private CallbackSaveWorker saveAs ( boolean showLoc ) {
FILE editingFILE = this . getEditingFILE ( ) ;
if ( editingFILE = = null ) {
@ -1975,7 +1981,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
@Override
public void saveDirectly ( ) {
if ( isSaving ( ) ) {
@ -2125,17 +2130,19 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/ * *
* 获取此模板所使用的tab栏操作类型
*
* @return
* /
public String getTemplateTabOperatorType ( ) {
public String getTemplateTabOperatorType ( ) {
return DEFAULT_TAB_OPERATOR ;
}
/ * *
* 当前模板是否可以被保存
*
* @return 是 / 否
* /
public boolean canBeSaved ( ) {
public boolean canBeSaved ( ) {
return true ;
}
@ -2144,15 +2151,16 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
*
* @return 是 / 否
* /
public boolean supportCache ( ) {
public boolean supportCache ( ) {
return true ;
}
/ * *
* 获取此模板在tab栏中显示的名称
*
* @return
* /
public String getTabShowName ( JTemplate < ? , ? > jTemplate ) {
public String getTabShowName ( JTemplate < ? , ? > jTemplate ) {
String name = TemplateUtils . createLockeTemplatedName ( jTemplate , jTemplate . getTemplateName ( ) ) ;
if ( ! jTemplate . isSaved ( ) & & ! name . endsWith ( " *" ) ) {
name + = " *" ;
@ -2162,9 +2170,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/ * *
* 切换环境之前是否需要保存
*
* @return
* /
public boolean needSaveBeforeSwitchEnv ( ) {
public boolean needSaveBeforeSwitchEnv ( ) {
return false ;
}