Skip to main content



      Home
Home » Eclipse Projects » NatTable » When selecting in NatTable only Rowheaders should change the background color
When selecting in NatTable only Rowheaders should change the background color [message #1129327] Tue, 08 October 2013 10:17 Go to next message
Eclipse UserFriend
Howdy,

first I wnat to say hello to this forum.

I am very new to NatTable. I want to implement a selection, that does only change the background color of the RowHeaders of the selected rows. I got the change of the RowHeaders' color in case of selection. My question is, how to could I draw a transparent SelectionRectangle over the cell? Has anyone an idea?
Re: When selecting in NatTable only Rowheaders should change the background color [message #1129433 is a reply to message #1129327] Tue, 08 October 2013 12:19 Go to previous messageGo to next message
Eclipse UserFriend
I think you simple need to remove the selection style that is registered in the DefaultSelectionStyleConfiguration
Re: When selecting in NatTable only Rowheaders should change the background color [message #1129973 is a reply to message #1129433] Wed, 09 October 2013 01:40 Go to previous messageGo to next message
Eclipse UserFriend
I don't have any DefaultSelectionStyleConfiguration. I have only my own configuration where I configure that the rowheader should be change the background color when selecting. But the rectangle on the cells is grey.

[Updated on: Wed, 09 October 2013 02:20] by Moderator

Re: When selecting in NatTable only Rowheaders should change the background color [message #1129977 is a reply to message #1129433] Wed, 09 October 2013 01:41 Go to previous messageGo to next message
Eclipse UserFriend
Edit: Double post

[Updated on: Wed, 09 October 2013 01:42] by Moderator

Re: When selecting in NatTable only Rowheaders should change the background color [message #1130027 is a reply to message #1129977] Wed, 09 October 2013 02:51 Go to previous messageGo to next message
Eclipse UserFriend
The DefaultSelectionStyleConfiguration is added by default when creating the SelectionLayer with default configuration. Or did you create the SelectionLayer with useDefaulConfiguration false?
As you are new to NatTable and selection is still working I suppose you didn't, which means the default style for selected cells is added.

So you have two ways to solve your issue:
1. unregister the value for CellConfigAttribute.CELL_STYLE for DisplayMode.SELECT (haven't tried that before)
2. register a style that is the same as the style for DisplayMode.NORMAL. But in that case it might override conditional stylings.
Re: When selecting in NatTable only Rowheaders should change the background color [message #1130144 is a reply to message #1130027] Wed, 09 October 2013 05:00 Go to previous messageGo to next message
Eclipse UserFriend
I created the SelectionLayer with useDefaulConfiguration=false in the hope the selection rectangle would be transparent...
I try both of your suggestions. Both leads to the result that the rectangle isn't transparent but has the background color white. I configure that the rows have the background color white and grey alternately. This is then overwritten and all selected cells have the background color white.
Re: When selecting in NatTable only Rowheaders should change the background color [message #1130188 is a reply to message #1130144] Wed, 09 October 2013 05:50 Go to previous messageGo to next message
Eclipse UserFriend
Try to register a style for the selection anchor and the selection that does not set a value for the background color.
Re: When selecting in NatTable only Rowheaders should change the background color [message #1130212 is a reply to message #1130188] Wed, 09 October 2013 06:20 Go to previous messageGo to next message
Eclipse UserFriend
That was it! Too simple to think in that way...Laughing

[Updated on: Wed, 09 October 2013 06:26] by Moderator

Re: When selecting in NatTable only Rowheaders should change the background color [message #1130220 is a reply to message #1130212] Wed, 09 October 2013 06:26 Go to previous message
Eclipse UserFriend
Thank you very much for the help Smile
Previous Topic:8.7 millions LinkedList$Node after 1 night
Next Topic:How to listen for RowReorderEvents?
Goto Forum:
  


Current Time: Sat Jul 12 21:49:26 EDT 2025

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

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

Back to the top