public class MyTheme extends SmoothTheme {
@Override
public void install(DockController controller)
{
super.install(controller);
controller.getIcons().setIconClient("statemanager.minimize",
UIManager.getIcon(IconConstants.DOCK_MINIMIZE));
}
}
and then doing setTheme(new MyTheme()) in my CControl. But the setTheme method is deprecated. How should i do this? Is there a way to just state that MyTheme is the default theme to use for all CControl’s in my application?
My second issue is with the “statemanager.minimize” string… is there a way to say the icon I’m giving will replace the minimize icon without hardcode that string? If the icons.ini is changed, my code will stop working…
The string, replace it with “StateManager.ICON_MANAGER_KEY_MINIMIZE”.
2.a. Calling “setIconClient” works independent from any theme, a client-icon is always “stronger” then a theme-icon. So you don’t necessarely need a new theme.
2.b. If you need the theme anyway:
Get the ThemeMap (CControl#getThemes) and register your theme there (ThemeMap#add). Later you can use CControl#setTheme(String) to set the new theme. ThemeMap has already some keys defined, you might want to use ThemeMap.KEY_SMOOTH_THEME for your theme.
Your theme should extend from “CSmoothTheme” instead of “SmoothTheme”.
You’ll need to implement a “ThemeFactory” for the ThemeMap, but that should not be hard.
There is no global method to set the default theme, you’ll need to do this procedure for each new CControl in your application.
Thanks for your help. I just have 2 small questions:
The close action does not have a variable in StateManager? Is it somewhere else?
Is it possible to (re)define the order of the actions in the title of the docks? my externalise action is next to the close button, but when I externalise it, the maximise button is between the normalise and close button… i find it a bit weird and would like to change that order.
Hm, no I think there is nowhere a constant defined. But it is “close” and unlikely to change.
The order is hardwired, to be exact the order is defined in “CStateManager#availableModes”. You would need to change this method.
Edit: and that would not include the close button, which is always at the right.