@ -60,6 +60,8 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
private UIButton saveButton = new UIButton ( ) ;
private UIButton saveAsButton = new UIButton ( ) ;
private TemplateThemeProfileActionListener actionListener = new TemplateThemeProfileActionAdapter ( ) ;
public TemplateThemeProfilePane ( TemplateThemeConfig < T > config ) {
super ( ) ;
this . config = config ;
@ -112,6 +114,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
return ;
}
saveButton . setEnabled ( valid & & isMutable ) ;
actionListener . onThemeNameChecked ( themeEditorPane . getThemeName ( ) , valid ) ;
}
} ) ;
@ -138,6 +141,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
if ( saveAsButton ! = null ) {
saveAsButton . setEnabled ( StringUtils . isNotEmpty ( name ) ) ;
}
isPopulating = false ;
}
@ -330,4 +334,19 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
this . dispose ( ) ;
}
}
public void addProfileActionListener ( TemplateThemeProfileActionListener actionListener ) {
if ( actionListener ! = null ) {
this . actionListener = actionListener ;
}
}
public interface TemplateThemeProfileActionListener {
void onThemeNameChecked ( String name , boolean valid ) ;
}
public static class TemplateThemeProfileActionAdapter implements TemplateThemeProfileActionListener {
@Override
public void onThemeNameChecked ( String name , boolean valid ) { }
}
}