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