Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to select a cell in a SWT table
How to select a cell in a SWT table [message #438324] Tue, 22 June 2004 08:39 Go to next message
Nicolas is currently offline NicolasFriend
Messages: 21
Registered: July 2009
Junior Member
Is it possible to only select a cell instead of a row in a SWT Table ?
How can I do this ?


Nicolas
Re: How to select a cell in a SWT table [message #438331 is a reply to message #438324] Tue, 22 June 2004 12:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ihazan.cablemx.com

In my apllication i defined a TableViewer and it is the default behavior.

Following is the code of the creation:

Table table = new Table(composite, SWT.BORDER | SWT.V_SCROLL |
SWT.H_SCROLL );

table.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
GridData.FILL_VERTICAL));

m_tableViewer = new TableViewer(table);

m_tableViewer.setContentProvider(new CMX_TableContentProvider());

m_tableViewer.setLabelProvider(new CMX_TableLabelProvider());





TableColumn column = new TableColumn(table, SWT.LEFT);

column.setText(CMX_EMSConfig.getProperty("com.cmx.ems.view_pane.attribute "))
;

column.setWidth(160);


TableColumn value_column =

new TableColumn(table, SWT.LEFT);

value_column.setText(CMX_EMSConfig.getProperty("com.cmx.ems.view_pane.value "
));

value_column.setWidth(160);

table.setHeaderVisible(true);




"Nicolas" <nicolas.buttin@eurobios.com> wrote in message
news:cb8rd6$9d5$1@eclipse.org...
> Is it possible to only select a cell instead of a row in a SWT Table ?
> How can I do this ?
>
>
> Nicolas
>
>
Re: How to select a cell in a SWT table [message #438337 is a reply to message #438331] Tue, 22 June 2004 14:27 Go to previous messageGo to next message
Nicolas is currently offline NicolasFriend
Messages: 21
Registered: July 2009
Junior Member
Maybe I made a mistake, but with your code, I can't select only a cell in
the table but I can select the row (the TableItem).
Do you something special in your CMX_TableContentProvider() ?

"Itzhak Hazan" <ihazan@cablemx.com> a
Re: How to select a cell in a SWT table [message #438413 is a reply to message #438337] Wed, 23 June 2004 15:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wohlgemuth.mpimp-golm.mpg.de

it depends only on the SWT. .... properties.
I think you must set SWT.SINGLE

and you become happy

gert

"Nicolas" <nicolas.buttin@eurobios.com> wrote in message
news:cb9fo7$qh0$1@eclipse.org...
> Maybe I made a mistake, but with your code, I can't select only a cell in
> the table but I can select the row (the TableItem).
> Do you something special in your CMX_TableContentProvider() ?
>
> "Itzhak Hazan" <ihazan@cablemx.com> a
Re: How to select a cell in a SWT table [message #438438 is a reply to message #438413] Thu, 24 June 2004 09:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: olivier.larivain.criltechnology.com

you define this with the style given to the table : don't pass
SWT.FULL_SELECTION to your table constructor, and you will be able to select
only cells.

"gert wohlgemuth" <wohlgemuth@mpimp-golm.mpg.de> a
Re: How to select a cell in a SWT table [message #438469 is a reply to message #438438] Fri, 25 June 2004 08:49 Go to previous messageGo to next message
Nicolas is currently offline NicolasFriend
Messages: 21
Registered: July 2009
Junior Member
If you delete SWT.FULL_SELECTION, you can only select the cells in the first
column.
Am I wrong ?


"LARIVAIN olivier" <olivier.larivain@criltechnology.com> a
Re: How to select a cell in a SWT table [message #438491 is a reply to message #438324] Fri, 25 June 2004 20:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: am560571.wcupa.edu

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/snippits/snippet124.html

Check this out...just change/delete some stuff so it doesn't let the user
edit the item

later,
Aaron

Nicolas wrote:

> Is it possible to only select a cell instead of a row in a SWT Table ?
> How can I do this ?


> Nicolas
Re: How to select a cell in a SWT table [message #438655 is a reply to message #438491] Tue, 29 June 2004 09:47 Go to previous messageGo to next message
Nicolas is currently offline NicolasFriend
Messages: 21
Registered: July 2009
Junior Member
Thank you Aaron for the links.
But it isn't exactly what I want to do.
I would like to use the standard selection but only for a cell not for the
complete item...


"whatsgoingon" <am560571@wcupa.edu> a
Re: How to select a cell in a SWT table [message #438671 is a reply to message #438324] Tue, 29 June 2004 17:13 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
See:

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/snippits/snippet96.html

"Nicolas" <nicolas.buttin@eurobios.com> wrote in message
news:cb8rd6$9d5$1@eclipse.org...
> Is it possible to only select a cell instead of a row in a SWT Table ?
> How can I do this ?
>
>
> Nicolas
>
>
Previous Topic:how to get the details of buffer whose text is selected?
Next Topic:Specify the default directory in a DirectoryDialog.
Goto Forum:
  


Current Time: Sat Apr 27 00:20:18 GMT 2024

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

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

Back to the top