Skip to main content



      Home
Home » Eclipse Projects » NatTable » NatTable TreeGridExample cell styling(Cell styling provided by input object as in Jface LabelProvider (getForeground, getFont, etc.))
NatTable TreeGridExample cell styling [message #931640] Wed, 03 October 2012 07:36 Go to next message
Eclipse UserFriend
Hi,
I've been working on Nattable's TreeGridExample trying to figure out how to implement some styles on different cells depending on the object value they contain, but I couldn't figure out how to do it. The only snippet available in the other examples that should do what I want to achieve is this:

CellOverrideLabelAccumulator<RowDataFixture> cellLabelAccumulator =
new CellOverrideLabelAccumulator<RowDataFixture>(gridLayer.getBodyDataProvider());
cellLabelAccumulator.registerOverride("AAA", 2, CELL_LABEL);

but it doesn't work. Adding a configuration to nattable doesn't seem to work, either. Even so I don't want my cells to be styled depending on the text value specified in the registerOverrride parameters, but taking it's style color from the object.
Could someone give me some pointers or some snippets?
Thanks, James
Re: NatTable TreeGridExample cell styling [message #931751 is a reply to message #931640] Wed, 03 October 2012 09:40 Go to previous message
Eclipse UserFriend
Hi James,

so what you are trying to do is conditional styling. Conditional styling is a two way process in NatTable. You have to attach labels to the cells you want to give a different style, and define and configure the special style against that label.

Have a look at the documentation chapter about contitional styling.
http://eclipse.org/nattable/documentation.php?page=styling

There are also some examples on that with the articles you can find here: http://eclipse.org/nattable/documentation.php?page=articles
Although the articles are written in german, the examples are documented in-code in english.

Hope this helps,
Dirk
Previous Topic:can treegrid be edit as nebula?
Next Topic:Re-release of 0.9.0 poi extension
Goto Forum:
  


Current Time: Sun Jul 27 00:17:09 EDT 2025

Powered by FUDForum. Page generated in 0.03581 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top