Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » selected column index given a TableItem
selected column index given a TableItem [message #450366] Thu, 10 February 2005 21:13 Go to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
Hi,

I have a class with a table with columns. The class also implements
org.eclipse.jface.viewers.ICellModifier.

My question:

My Eclipse call my implementation of ICellModifier.modify(Object
element, String property, Object value), how would I know the column
index WITHOUT using the "property" value? In other words, can I used
the passed in 'element', which is a TableItem, to find out which column
index/id was edited?

Many thanks!
Re: selected column index given a TableItem [message #450390 is a reply to message #450366] Fri, 11 February 2005 13:43 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
A table item can be selected in many ways. If it is selected through a
mouse event, you can get the x/y-coordinates from the mouse event and
determine the column at the point using one of the following snippets:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet3.java?rev=HEAD&am p;content-type=text/vnd.viewcvs-markup
or
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet110.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup

However, a table item can be selected by using the arrow keys or
programmatically. In these cases, you can't really specify on which column
the selection occurred because the whole row is selected.

"AL" <unbonnevie@yahoo.com> wrote in message
news:cugihf$chk$1@www.eclipse.org...
> Hi,
>
> I have a class with a table with columns. The class also implements
> org.eclipse.jface.viewers.ICellModifier.
>
> My question:
>
> My Eclipse call my implementation of ICellModifier.modify(Object element,
> String property, Object value), how would I know the column index WITHOUT
> using the "property" value? In other words, can I used the passed in
> 'element', which is a TableItem, to find out which column index/id was
> edited?
>
> Many thanks!
>
Previous Topic:Urgent - Update of Windows - DOM-OleAutamation
Next Topic:Limiting the number of rows in a table for viewing
Goto Forum:
  


Current Time: Thu Apr 25 08:00:35 GMT 2024

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

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

Back to the top