Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Change background color for table cell
Change background color for table cell [message #464500] Wed, 23 November 2005 15:06 Go to next message
Eclipse UserFriend
Originally posted by: wei.xie.lehman.com

Hi, any one know how to change the background colors for a table cell?
Ex: if a table is full selected (SWT.FULL_SELECTION) and have three
columns, if I selected one row, how do I change the column1 to green,
column 2 to red...
BTW: if only call TableItem.setBackground(col, color), it will not working
due to the background color will overriden by the default selected
background color.
Re: Change background color for table cell [message #464512 is a reply to message #464500] Wed, 23 November 2005 15:55 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
There is currently no way to change the selection color (for a row or a
single cell).

You could try using TableCursor for selecting individual cells.

See:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet96.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup

"W Xie" <wei.xie@lehman.com> wrote in message
news:d6e4575a38cda0ffce76b2dbe0c3cb98$1@www.eclipse.org...
> Hi, any one know how to change the background colors for a table cell? Ex:
> if a table is full selected (SWT.FULL_SELECTION) and have three columns,
> if I selected one row, how do I change the column1 to green, column 2 to
> red...
> BTW: if only call TableItem.setBackground(col, color), it will not working
> due to the background color will overriden by the default selected
> background color.
>
Re: Change background color for table cell [message #464521 is a reply to message #464512] Wed, 23 November 2005 17:58 Go to previous message
Eclipse UserFriend
Originally posted by: wei.xie.lehman.com

Thanks for your replay. Actually I try it before, TableCursor only can
change the background color for itself, so as long as we cannot change the
selection color, it will not work.

Veronika Irvine wrote:

> There is currently no way to change the selection color (for a row or a
> single cell).

> You could try using TableCursor for selecting individual cells.

> See:

>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet96.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup
Previous Topic:custom table scrolling events?
Next Topic:How to open Web page from my plugin???
Goto Forum:
  


Current Time: Thu Apr 25 00:27:44 GMT 2024

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

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

Back to the top