Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problems with Table
Problems with Table [message #462950] Fri, 21 October 2005 18:14 Go to next message
Thomas Mauch is currently offline Thomas MauchFriend
Messages: 30
Registered: July 2009
Member
Two questions:

1) Unselecting all rows in a table
How can I unselect all rows in a table? If I just created the table,
getSelectionIndex() returns -1 indicating that no row is selected. After the
user has selected a row however, I was not succesful to unselect that row
again: setSelectionIndex(-1) seems to be ignored...

2) I want to use a Table just for displaying data and the user should not be
able to do any manipulation. When I call setEnabled(false) however, fore-
and background color get greyed out. Is there another way to achieve a
similiar behavior without setEnabled() where colors still work?

Thanks,
Thomas
Re: Problems with Table [message #462956 is a reply to message #462950] Fri, 21 October 2005 21:48 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
Table#deselectAll() is the proper method (I think). Double check that one.

Tables are non-editable by default. In fact, you really need to go out of your way to make them editable. I'm not sure why you would be having problems with this. Perhaps you could clarify exactly what is happening which is undesirable?
Re: Problems with Table [message #462985 is a reply to message #462956] Mon, 24 October 2005 23:22 Go to previous messageGo to next message
Thomas Mauch is currently offline Thomas MauchFriend
Messages: 30
Registered: July 2009
Member
Thank for your answer. I was looking for unselect() and did miss deselect().

I think you're right that I must clarify what I mean with editable. When a
table is enabled, the user can select one row of a table item which will be
displayed in another color. This should not be possible in my appliation.
What I am doing right now is to deselect the row just selected by the user
as soon the table gets the focus. So in fact I want to prevent the table
from getting the focus without getting enabled.

When I remember my Microsoft Access days, you had the possibility to set the
properties "locked" and "enabled" on UI elements to achieve the behavior
described. Is there a similar concept in SWT?

Thomas
Re: Problems with Table [message #462987 is a reply to message #462985] Tue, 25 October 2005 04:04 Go to previous message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
> When I remember my Microsoft Access days, you had the possibility to set
> the properties "locked" and "enabled" on UI elements to achieve the
> behavior described. Is there a similar concept in SWT?
>
This is trick only - you can have property 'locked' and 'enabled'
and change colors of table when this properties change
Previous Topic:FieldEditor does not write default-value
Next Topic:How to dermine if Shift Key is down?
Goto Forum:
  


Current Time: Thu Mar 28 13:44:14 GMT 2024

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

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

Back to the top