There are several ways to create a new theme using this configuration as basis:
new DefaultNatTableThemeConfiguration { { this.defaultFgColor = GUIHelper.COLOR_BLUE; ... } }
While this ThemeConfiguration only contains the basic styling, you are also able to extend this and add additional stylings, e.g. conditional stylings for custom labels. But on adding new stylings you also need to ensure that the custom styling is removed in {@link ThemeConfiguration#unregisterThemeStyleConfigurations(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)}. This is necessary so the applied styles do not stay in case of theme switches.
Instead of extending an existing ThemeConfiguration you are also able to create and register {@link IThemeExtension}s to add additional styling. Creating IThemeExtension gives you the most possible flexibility on creating, modifying and extending existing themes.
Note: If styling of the GroupBy header should also be involved in the theme, you need to register a matching IThemeExtension out of the GlazedLists extension. The reason for this is that the labels against which the styles need to be registered are specified there, and there should be no dependency from core to the extensions. Have a look at the DefaultGroupByThemeExtension or the ModernGroupByThemeExtension for example.
@author Dirk Fauth
|
|
|
|