Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Set Background color to the selected portion in the tree..(The column color shall differentiate between the selected and non-selected columns.)
Set Background color to the selected portion in the tree.. [message #1647728] Tue, 03 March 2015 15:31 Go to next message
Amol Salunke is currently offline Amol SalunkeFriend
Messages: 16
Registered: March 2015
Junior Member
Hello,

I have requirement where we need to set the perticular background color when we select the group of column. It means, The column color shall differentiate between the selected and non-selected columns.

Ina nattable where we have hierarchical structure and non hierarchical structure,
we set the Background color(gray) to the tree structure(hierarchical structure ) and default (white) to non hierarchical structure.

I have tried to set the background color using 'configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,selectionCellStyle,DisplayMode.SELECT); '.

But this color sets only the non hierarchical structure in the body as this is configregistry for Nattable not the tree.

Question is: What I need to do to change the background color for hierarchical structure as well to the selected columns.

Could you please suggest?

[Updated on: Tue, 03 March 2015 15:32]

Report message to a moderator

Re: Set Background color to the selected portion in the tree.. [message #1647747 is a reply to message #1647728] Tue, 03 March 2015 15:40 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
You need to register the style also for DisplayMode#SELECT in combination with the label TreeLayer#TREE_COLUMN_CELL
Re: Set Background color to the selected portion in the tree.. [message #1649521 is a reply to message #1647747] Wed, 04 March 2015 11:13 Go to previous messageGo to next message
Amol Salunke is currently offline Amol SalunkeFriend
Messages: 16
Registered: March 2015
Junior Member
Hello Dirk,
Thanks for your help.

I tried with the sugggested approach (configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,selectionCellStyle,DisplayMode.SELECT,TreeLayer.TREE_COLUMN_CELL); ) but it seems only the first colum is
changing it's background color.

Does it consider the TreeLayer.TREE_COLUMN_CELL equals the first column or I am missing something??

How Can I change the background color for selected portion either hierarchical or non hierachical structure?

Could you please help???
Re: Set Background color to the selected portion in the tree.. [message #1649575 is a reply to message #1649521] Wed, 04 March 2015 11:45 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
Quote:
Does it consider the TreeLayer.TREE_COLUMN_CELL equals the first column


Yes

Quote:
How Can I change the background color for selected portion either hierarchical or non hierachical structure?


I don't understand your question. What do you mean with hierarchical and non hierarchical structure?

As I said before, you need to register for DisplayMode#SELECT AND for DisplayMode#SELECT in combination with TreeLayer.TREE_COLUMN_CELL. So you need to register the style two times. Or ensure there is no style registered for TreeLayer.TREE_COLUMN_CELL anywhere. If that doesn't fit your needs, I don't know what to suggest since I don't understand what you are trying to do then.

Previous Topic:Need help to Customize copy-paste on NAT table
Next Topic:Need help to Customize copy-paste on NAT table
Goto Forum:
  


Current Time: Mon Mar 08 10:20:52 GMT 2021

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

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

Back to the top