|
|
|
@ -191,8 +191,8 @@ public class TemplateThemeManagePane<T extends TemplateTheme> extends BasicPane
|
|
|
|
|
MenuDef menuDef = new MenuDef(Toolkit.i18nText("Fine-Design_Basic_Action_Add")); |
|
|
|
|
menuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH); |
|
|
|
|
menuDef.setRePaint(true); |
|
|
|
|
menuDef.addShortCut(new AddThemeAction(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Create_Light_Theme"), config.getLightThemeName4New())); |
|
|
|
|
menuDef.addShortCut(new AddThemeAction(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Create_Dark_Theme"), config.getDarkThemeName4New())); |
|
|
|
|
menuDef.addShortCut(new AddThemeAction(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Create_Light_Theme"), config.getDefaultLightThemeName())); |
|
|
|
|
menuDef.addShortCut(new AddThemeAction(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Create_Dark_Theme"), config.getDefaultDarkThemeName())); |
|
|
|
|
|
|
|
|
|
return menuDef; |
|
|
|
|
} |
|
|
|
@ -232,31 +232,27 @@ public class TemplateThemeManagePane<T extends TemplateTheme> extends BasicPane
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private class AddThemeAction extends UpdateAction { |
|
|
|
|
private T prototypeTheme; |
|
|
|
|
private final String prototypeThemeName; |
|
|
|
|
|
|
|
|
|
public AddThemeAction(String name, String prototypeThemeName) { |
|
|
|
|
setName(name); |
|
|
|
|
setMnemonic('R'); |
|
|
|
|
asyncThemeFetcher.submit(prototypeThemeName, new AsyncThemeFetcher.AsyncThemeFetchCallbackAdapter<T>() { |
|
|
|
|
@Override |
|
|
|
|
public void beforeCachedFetch() { |
|
|
|
|
super.beforeCachedFetch(); |
|
|
|
|
prototypeTheme = null; |
|
|
|
|
this.prototypeThemeName = prototypeThemeName; |
|
|
|
|
asyncThemeFetcher.submit(prototypeThemeName, null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
asyncThemeFetcher.submit(prototypeThemeName, new AsyncThemeFetcher.AsyncThemeFetchCallbackAdapter<T>() { |
|
|
|
|
@Override |
|
|
|
|
public void afterCachedFetch(T theme) { |
|
|
|
|
super.afterCachedFetch(theme); |
|
|
|
|
prototypeTheme = theme; |
|
|
|
|
createNewTheme(theme); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
if (prototypeTheme == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
private void createNewTheme(T prototypeTheme) { |
|
|
|
|
Window parent = SwingUtilities.getWindowAncestor(TemplateThemeManagePane.this); |
|
|
|
|
TemplateThemeProfileDialog<T> profileDialog = new TemplateThemeProfileDialog<>(parent, profilePane); |
|
|
|
|
try { |
|
|
|
|