Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Set background color to specific row(i have a nattable data , i want to color the background of every row based on the input. is it possible to do it?)
Set background color to specific row [message #1713564] Thu, 05 November 2015 08:13 Go to next message
Amol Salunke is currently offline Amol SalunkeFriend
Messages: 16
Registered: March 2015
Junior Member
i have a nattable data , i want to color the background of every row based on the input. is it possible to do it?

[Updated on: Thu, 05 November 2015 08:14]

Report message to a moderator

Re: Set background color to specific row [message #1713579 is a reply to message #1713564] Thu, 05 November 2015 09:41 Go to previous message
Alpha Foxtrott is currently offline Alpha FoxtrottFriend
Messages: 8
Registered: July 2015
Junior Member
Of course it is!

You can achieve this with the use of config labels. You have to register a ConfigLabelAccumulator, which adds the configLabel based on a condition (e.g. LABEL_RED for negative Numbers, LABEL_GREEN for positive Numbers, etc.).
Second you have to register a specific cell style for this configLabel.

I recommend downloading the natTableExamples (http://www.eclipse.org/downloads/download.php?file=/nattable/releases/1.3.0/NatTableExamples-1.3.0.jar), there are plenty of examples, and also one regarding your question (at Classic Examples -> Styling -> Custom styling of specific cells).

If you are new to NatTable and the examples, here is a quick guide for installing the examples: https://eclipse.org/nattable/documentation.php?page=getting_started

And here is an very good beginners guide for getting started with NatTable: http://www.vogella.com/tutorials/NatTable/article.html

Hope it helps!

André
Previous Topic:sorting a tree column with equal roots issue
Next Topic:nattable is not getting updated on adding the data to eventlist
Goto Forum:
  


Current Time: Wed Sep 25 17:07:49 GMT 2024

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

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

Back to the top