Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Cell selection in a tableviewer
Cell selection in a tableviewer [message #325677] Mon, 25 February 2008 16:38 Go to next message
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
Hello,

i have more than one cell in a line. Now i want to select the second or
the third cell in this line. What code i need to make this possilble?

Greetings
Re: Cell selection in a tableviewer [message #325682 is a reply to message #325677] Mon, 25 February 2008 16:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Jörg,

I've not used it yet, but I think org.eclipse.swt.custom.TableCursor
would be used for that purpose.


Jörg wrote:
> Hello,
>
> i have more than one cell in a line. Now i want to select the second
> or the third cell in this line. What code i need to make this possilble?
>
> Greetings
Re: Cell selection in a tableviewer [message #325688 is a reply to message #325682] Mon, 25 February 2008 17:07 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
There are multiple possibilities since 3.3. SWT-Tables and Trees don't
have the idea of a Cell. That's why JFace holds a bunch of code to make
such a feature available to you (although we don't support SWT.MULTI).

Take a look at the various snippets:
http://wiki.eclipse.org/JFaceSnippets#Snippet026TreeViewerTa bEditing

Tom

Ed Merks schrieb:
> Jörg,
>
> I've not used it yet, but I think org.eclipse.swt.custom.TableCursor
> would be used for that purpose.
>
>
> Jörg wrote:
>> Hello,
>>
>> i have more than one cell in a line. Now i want to select the second
>> or the third cell in this line. What code i need to make this possilble?
>>
>> Greetings


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Cell selection in a tableviewer [message #325703 is a reply to message #325688] Mon, 25 February 2008 18:07 Go to previous messageGo to next message
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
Thanks for your help. Both method does what i want. I have it now done
with the focusCellManager. But a little problem exist here, I got the
columnindex with this focusCellManager.getFocusCell().getColumnIndex(),
but how can i get the index of the row?

Tom Schindl schrieb:
> There are multiple possibilities since 3.3. SWT-Tables and Trees don't
> have the idea of a Cell. That's why JFace holds a bunch of code to make
> such a feature available to you (although we don't support SWT.MULTI).
>
> Take a look at the various snippets:
> http://wiki.eclipse.org/JFaceSnippets#Snippet026TreeViewerTa bEditing
>
> Tom
>
> Ed Merks schrieb:
>> Jörg,
>>
>> I've not used it yet, but I think org.eclipse.swt.custom.TableCursor
>> would be used for that purpose.
>>
>>
>> Jörg wrote:
>>> Hello,
>>>
>>> i have more than one cell in a line. Now i want to select the second
>>> or the third cell in this line. What code i need to make this possilble?
>>>
>>> Greetings
>
>
Re: Cell selection in a tableviewer [message #325705 is a reply to message #325703] Mon, 25 February 2008 18:11 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
This is not possible. SWT doesn't has direct API to fetch the row-index
and for viewers it is most of the time not important because the
Model-Object should hold all the data but you could easily calculate it
from the Cell-Bounds or even better if you are in-single-select-mode
(which you must :-) query to the table for the current-selection-index.

Tom

Jörg schrieb:
> Thanks for your help. Both method does what i want. I have it now done
> with the focusCellManager. But a little problem exist here, I got the
> columnindex with this focusCellManager.getFocusCell().getColumnIndex(),
> but how can i get the index of the row?
>
> Tom Schindl schrieb:
>> There are multiple possibilities since 3.3. SWT-Tables and Trees don't
>> have the idea of a Cell. That's why JFace holds a bunch of code to
>> make such a feature available to you (although we don't support
>> SWT.MULTI).
>>
>> Take a look at the various snippets:
>> http://wiki.eclipse.org/JFaceSnippets#Snippet026TreeViewerTa bEditing
>>
>> Tom
>>
>> Ed Merks schrieb:
>>> Jörg,
>>>
>>> I've not used it yet, but I think org.eclipse.swt.custom.TableCursor
>>> would be used for that purpose.
>>>
>>>
>>> Jörg wrote:
>>>> Hello,
>>>>
>>>> i have more than one cell in a line. Now i want to select the second
>>>> or the third cell in this line. What code i need to make this
>>>> possilble?
>>>>
>>>> Greetings
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Previous Topic:ErrorSupportProvider and UI for ErrorDialog
Next Topic:setSelection() in Virtual Table misbehaves
Goto Forum:
  


Current Time: Sun Sep 01 11:18:37 GMT 2024

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

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

Back to the top