Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » [Table] Individual colors for each cell possible?
[Table] Individual colors for each cell possible? [message #1714022] Mon, 09 November 2015 12:52 Go to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 71
Registered: July 2009
Member
Hi,

I am currently trying to convert a Swing application to RAP which contains a quite customized JTable component.

One of the areas where I haven't found a solution is coloring of individual cells, used to illustrate the result of input validation.
What is the way to go when each cell requires custom background/forground - the background should fill the cell and not only the text. I saw OwnerDrawLabelProvider/StyledCellLabelProvider as well as the low-level Erease-Event/Paint-Event is not supported by RAP. Is there any way to assign background/forground for each table cell manually?

Thank you in advance, Clemens
Re: [Table] Individual colors for each cell possible? [message #1714033 is a reply to message #1714022] Mon, 09 November 2015 13:45 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
TableItem.setBackground(int, Color) and TableItem.setForeground(int,
Color) is what you are looking for.
HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: [Table] Individual colors for each cell possible? [message #1714047 is a reply to message #1714033] Mon, 09 November 2015 14:33 Go to previous message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 71
Registered: July 2009
Member
Hi Ivan,

At first I was a bit confused, because I am using a virtual table and therefore the TableItems are created by the Table itself on demand.
Using a SWT.SetData listener did the trick even for the virtual table.

Thanks a lot for the pointer Smile

Best regards, Clemens
Previous Topic:Different deploy approach then war product
Next Topic:badge on the right in treeviewer
Goto Forum:
  


Current Time: Tue Mar 19 02:48:14 GMT 2024

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

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

Back to the top