The GXT system provides a handy way of switching/changing themes dynamically or at runtime, instead of having to always do it in code and recompile to see it in action. Runtime theme switching is done with a ThemeSelector
widget, which is actually a ComboBox
extension.
It presents to the user the available themes provided by (and registered with) the ThemeManager
, such that the user can then select any theme from the list and have it applied immediately.
The following screenshots show the ThemeSelector
widget and the result of selecting the Access theme on a component:
Create a ThemeSelector
widget and place it on the screen. From that point, the widget takes control and does all the work needed to change to a theme as long as the themes are placed in the right places expected of them (see the Getting ready section of the first recipe, Setting a default theme, in this chapter) by the GXT system.
@Override public void onModuleLoad() { // Although...