Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Theme style configurations
Theme style configurations [message #1234211] Tue, 21 January 2014 08:10 Go to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1233
Registered: July 2012
Senior Member
As part of finishing NatTable 1.1 we added theme style configurations to NatTable Core. Technically they are of type AbstractRegistryConfiguration and can be registered to a NatTable like any other configuration.

I created the DefaultNatTableThemeConfiguration which contains AFAIK all possible default style attributes that can be set. So using this as a starting point should give you as much help as possible to be able to create your custom theme. You could simply extend and override the values or override the methods to specify the styles.

To support theme switching at runtime, I introduced the ThemeManager. It is tight connected to the NatTable and the IConfigRegistry of that NatTable instance, so it is able to perform configuration modifications. By calling NatTable.setTheme(ThemeConfiguration) you can switch the theme at runtime.

In the repository you will find a new example _423_ThemeStylingExample, that shows some simple themes and the ability to switch between them. Note that it is not yet contained in the NatTable examples app, but it is planned to add it to the new examples version in the future.

Note that there are some attributes that can not be set via ThemeConfiguration. Most important might be row height and column width, which are no style informations in the current architecture. Compared to CSS this might be confusing.
Also the ILayerPainter can not be changed via themes. Usually you don't need this, but there are use cases where you might want to change the grid line color or even avoid rendering grid lines. This need to be done in another way, as they are tight connected to the ILayer in the current architecture.

It would be great if someone else could step up to test this so we can be sure this feature is ready to be released.

Please report any issues in this ticket: https://bugs.eclipse.org/bugs/show_bug.cgi?id=382863
Re: Theme style configurations [message #1251455 is a reply to message #1234211] Thu, 20 February 2014 03:30 Go to previous message
Arjan Kok is currently offline Arjan Kok
Messages: 29
Registered: July 2009
Junior Member
Hi,

I've create my own Theme Configuration, and it works smoothly. Also theme switching at runtime works fine - the fonts in my theme can now be set by the user via an eclipse preference.

Thanks & Regards,

Arjan Kok.
Previous Topic:Text edition and new line
Next Topic:update/refresh NatTable after updating the POJO
Goto Forum:
  


Current Time: Thu Jul 31 17:57:09 EDT 2014

Powered by FUDForum. Page generated in 0.06747 seconds