Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » how to select the elements in a table
how to select the elements in a table [message #194331] Thu, 15 February 2007 09:34 Go to next message
zakir Hussain is currently offline zakir HussainFriend
Messages: 76
Registered: July 2009
Member
I am having a table with 4 columns...

I want to select the elements in the table..........

but i am not able to select... any element from other than 1st column....

Could you plz give me any suggestions..

Regards,

Zakir
Re: how to select the elements in a table [message #194354 is a reply to message #194331] Thu, 15 February 2007 11:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Zakir,

I think (but am not sure) that org.eclipse.swt.custom.TableCursor might
help (although I've never tried it).


zakir wrote:
> I am having a table with 4 columns...
>
> I want to select the elements in the table..........
>
> but i am not able to select... any element from other than 1st column....
>
> Could you plz give me any suggestions..
>
> Regards,
>
> Zakir
>
Re: how to select the elements in a table [message #194493 is a reply to message #194354] Thu, 15 February 2007 13:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: csae7511.uibk.ac.at

When you instantiate the table with SWT.FULL_SELECTION, you are able to
select the whole row.

Does this solve your problem?

Regards,
Stefan

Ed Merks schrieb:
> Zakir,
>
> I think (but am not sure) that org.eclipse.swt.custom.TableCursor might
> help (although I've never tried it).
>
>
> zakir wrote:
>> I am having a table with 4 columns...
>>
>> I want to select the elements in the table..........
>>
>> but i am not able to select... any element from other than 1st column....
>>
>> Could you plz give me any suggestions..
>>
>> Regards,
>>
>> Zakir
>>
Re: how to select the elements in a table [message #194509 is a reply to message #194493] Thu, 15 February 2007 17:44 Go to previous messageGo to next message
zakir Hussain is currently offline zakir HussainFriend
Messages: 76
Registered: July 2009
Member
HI Stefan,

I want to select only particular cell in a table.........not whole row...

Could you please suggest me regarding this...

Regards,

Zakir
Re: how to select the elements in a table [message #194521 is a reply to message #194509] Thu, 15 February 2007 17:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: csae7511.uibk.ac.at

Hi Zakir,

you'll find more information about that in the swt newsgroup.

e.g.
http://dev.eclipse.org/newslists/news.eclipse.platform.swt/m sg16200.html

Regards,
Stefan

zakir schrieb:
> HI Stefan,
>
> I want to select only particular cell in a table.........not whole row...
>
> Could you please suggest me regarding this...
>
> Regards,
>
> Zakir
>
Re: how to select the elements in a table [message #194533 is a reply to message #194509] Thu, 15 February 2007 18:03 Go to previous message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

You will need to create a Listener for SWT.MouseDown on your table. In your
listener, you will then need to check if the co-ordinates lie within an editable
cell. Here is a snippet to get you started:


table.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
Rectangle clientArea = table.getClientArea();
Point pt = new Point(event.x, event.y);
int index = table.getTopIndex();
while (index < table.getItemCount()) {
boolean visible = false;
final TableItem item = table.getItem(index);
Rectangle rect = item.getBounds(EDITABLECOLUMN);
if (rect.contains(pt)) {
setEditors(tEditor, EDITABLECOLUMN, item);
}
if (!visible && rect.intersects(clientArea)) {
visible = true;
}
if (!visible)
return;
index++;
}
}
});

setEditors is a function I have written to create an editable Text field over a
cell. EDITABLECOLUMN is a constant of mine as I only ever want to allow editing
on a single column.

HTH
--
Derek


zakir wrote:
> HI Stefan,
>
> I want to select only particular cell in a table.........not whole row...
>
> Could you please suggest me regarding this...
>
> Regards,
>
> Zakir
>
Previous Topic:Wizards and disappearing controls pt 2
Next Topic:Eclipse contributor's guide?
Goto Forum:
  


Current Time: Wed Apr 24 18:25:44 GMT 2024

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

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

Back to the top