Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to disable a cell in TableViewer
How to disable a cell in TableViewer [message #437569] Mon, 07 June 2004 15:18 Go to next message
Eclipse UserFriend
Originally posted by: gtoor.pervasive.com

I am using the a TableViewer and want to disable cells within
the table. I would like to set the background color to let the
user know the cell is not editable. I have implemented
ICellModifier.canModify() but don't really like the implementation since it
gives no visual cues as to which cells cannot be modified. And
unfortunately, TableItem.setBackground() sets the background color of the
entire row.

thanks in advance.
Gagan
Re: How to disable a cell in TableViewer [message #437588 is a reply to message #437569] Tue, 08 June 2004 14:19 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Try TableItem.setBackground (int index, Color color):

/**
* Sets the background color at the given column index in the receiver
* to the color specified by the argument, or to the default system color for
the item
* if the argument is null.
*
* @param index the column index
* @param color the new color (or null)
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that
created the receiver</li>
* </ul>
*
* @since 3.0
*
*/
public void setBackground (int index, Color color)


"Gagan Toor" <gtoor@pervasive.com> wrote in message
news:ca20k9$18l$1@eclipse.org...
> I am using the a TableViewer and want to disable cells within
> the table. I would like to set the background color to let the
> user know the cell is not editable. I have implemented
> ICellModifier.canModify() but don't really like the implementation since
it
> gives no visual cues as to which cells cannot be modified. And
> unfortunately, TableItem.setBackground() sets the background color of the
> entire row.
>
> thanks in advance.
> Gagan
>
>
Previous Topic:Custom SWT components
Next Topic:TableTree +/- signs
Goto Forum:
  


Current Time: Fri Apr 19 19:03:59 GMT 2024

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

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

Back to the top