Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Decorate icons with text in NatTable Tree(Can I get any sample code to display different icons along with text in NatTable tree)
Decorate icons with text in NatTable Tree [message #1020620] Mon, 18 March 2013 15:24 Go to next message
Sunil Jakkaraju is currently offline Sunil JakkarajuFriend
Messages: 1
Registered: March 2012
Junior Member
Hi Experts,

I tried rendering images/icons along with text for NatTable tree using the ImagePainter with Decorator. However it either displayes only icons or does not display anything at all.


My requirement is to display different icons based on different values for the row. I have noticed one limitation, the call back to render images only works on the given cell only. however the icons to be rendered is based on the value of the different cell.

for example, the icons shold be diplayed in first column (render country flag). However the condition based on which the value is to be displayed in in 5th column (country name).

How can we accomplish the same using NatTable. Do you have any such example?

Thanks,
Sunil


Re: Decorate icons with text in NatTable Tree [message #1021280 is a reply to message #1020620] Tue, 19 March 2013 19:37 Go to previous message
Dirk Fauth is currently online Dirk FauthFriend
Messages: 1431
Registered: July 2012
Senior Member
Hi,

usually I decorate text with an icon and not vice versa. Smile
You can have a look at TreeGridWithCheckBoxFieldsExample which shows how to add checkboxes to the left of text in a tree. That should be similar to what you are trying to do.

Configuring icons regarding values in other columns is possible. You just need to create an IConfigLabelAccumulator that knows about the IDataProvider and attach labels regarding values in other columns. I think the examples which I created for my articles contain something similar. At least there I add labels to all cells in a row regarding a value in one column. You can find the links to the examples here: http://eclipse.org/nattable/documentation.php?page=articles

Note that the examples where created using the Sourceforge versions of NatTable (prior to the Eclipse move). So they won't compile unless you update the import statements.

Hope that helps,
Dirk
Previous Topic:Bug in VerticalTextPainter.paintCell()
Next Topic:table reinit scrollbars problem
Goto Forum:
  


Current Time: Fri Dec 19 09:38:38 GMT 2014

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

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