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