| Mark same column values by the same color [message #964045] |
Tue, 30 October 2012 04:05  |
Michi Classen Messages: 29 Registered: March 2012 |
Junior Member |
|
|
Does NatTable provide a functionality to mark the same column values with the same color?
E.g.
|rabbit|
|pig|
|rabbit|
|crocodile|
|pig|
...
This function will be turned off/on, therefore the marking is done by an activated command/handler.
|
|
|
|
|
|
|
| Re: Mark same column values by the same color [message #985672 is a reply to message #965784] |
Thu, 15 November 2012 11:21   |
Michi Classen Messages: 29 Registered: March 2012 |
Junior Member |
|
|
Is it possible to set the backing data value of a cell explicitly, which is different to the display value?
This is necessary to hightlight those columns only, which have the same backing data value, e.g.
E.g.
|animal | backing data value|
=========================
|rabbit | r1 |
|pig | p1 |
|rabbit | r1 |
|crocodile| c1 |
|pig | p2 |
...
In this case the text 'pig' in row 2 and 5 isn't marked by the same color.
[Updated on: Thu, 15 November 2012 11:34] Report message to a moderator
|
|
|
| Re: Mark same column values by the same color [message #985787 is a reply to message #985672] |
Fri, 16 November 2012 03:04  |
Dirk Fauth Messages: 525 Registered: July 2012 |
Senior Member |
|
|
I'm not quite sure what you are trying to do. But here's what I think would be the solution you are asking for.
As explained in the documentation, you can do conditional styling in several ways. http://eclipse.org/nattable/documentation.php?page=styling
You have to think of the CellOverrideLabelAccumulator, ColumnOverrideLabelAccumulator and RowOverrideLabelAccumulator as convenience label overriders, as they can be used for the most common cases where styles should be applied because of the cell content.
If you need a solution that interprets other values than the shown value for styling, you should create your own IConfigLabelAccumulator that knows the data provider or whatever is needed to get your backing data. Usually this data is also available within the objects you are showing, but you can also think of another datastore that holds that data. This depends on your architecture.
You will also find an example for this in the examples that are added to the articles written about NatTable.
I hope this answers your question,
Dirk
|
|
|
Powered by
FUDForum. Page generated in 0.01816 seconds