Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Re: Jump into first cell of Table
Re: Jump into first cell of Table [message #4429] Wed, 13 May 2009 09:18 Go to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Why not useing TableViewer#editElement(Object,int). Please let's follow
up on JFace-questions on the eclipse.platform.jface-Newsgroup.

Tom

T. Wilhelm schrieb:
> The problem is that i dont know how to call the "auto-edit logic". There
> is a triggerActivationEvent() Method but this method wants a Viewercell
> and optional an event (but NOT a focusGainedEvent).
> Any idea?
> Thanks alot.
> Thomas
>
>
> Ben Vitale wrote:
>
>> Perhaps you just set a flag..
>
>> 1. Table created. Flag=false
>> 2. Focus gained. Set flag. Do auto-edit logic
>> 3. Focus gained again. Flag is set, do nothing
>> 4. Focus lost. Unset flag
>> 5. .. <repeat> ..
>
>> If I am over-simplifying, I apologize :)
>
>> HTH
>> Ben
>
>> T. Wilhelm wrote:
>>> Hey all ,
>>>
>>> i have the following problem: I have a table and i want that when it
>>> gains the focus that it automatically jumps into the first editable
>>> Cell and goes into the edit mode, so iŽm able to start editing
>>> directly when the table gets the focus.
>>> First i try to implement an FocusGained Listener and everything
>>> works, BUT it has the sideeffect that when i click into the table on
>>> another cell (not the first one) it also jumps to the first cell :-(
>>> Maybe i can solve it via a traverse listener?
>>> Does anyone has any idea? Thanks alot.
>>> Thomas
>>>
>
>
Re: Jump into first cell of Table [message #4498 is a reply to message #4429] Wed, 13 May 2009 09:40 Go to previous messageGo to next message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Oh iŽm sorry, next time i will use the jface newsgroup.

I already used editElement() but the problem is that when i click with my
mouse on a special cell, this cell should be edit, not the first one. If i
enter the table in another way (i.e. press TAB) then the first cell should
be editet.

So i had the idea that i implement a check in the focusGained method if
the focus was gained by mouse or by Tab, but i couldnt find anything in my
event class which could help me :-(

Thomas
Re: Jump into first cell of Table [message #4568 is a reply to message #4498] Wed, 13 May 2009 09:48 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I don't think that focus gained is a good strategy because you receive
this event when ever an editor is open and closed.

I'm not sure either how to implement this feature without experimenting
with the various events.

Tom

T. Wilhelm schrieb:
> Oh iŽm sorry, next time i will use the jface newsgroup.
> I already used editElement() but the problem is that when i click with
> my mouse on a special cell, this cell should be edit, not the first one.
> If i enter the table in another way (i.e. press TAB) then the first cell
> should be editet.
> So i had the idea that i implement a check in the focusGained method if
> the focus was gained by mouse or by Tab, but i couldnt find anything in
> my event class which could help me :-(
>
> Thomas
>
Re: Jump into first cell of Table [message #4846 is a reply to message #4568] Thu, 14 May 2009 06:53 Go to previous message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
hey,

well i also came to this point, so i thought about other strategies or
events. I thought about using the traverse listener but i cant use it
since its only active when iŽm already in the table, i will experiment
with some other listeners. Anyway thanks for your help, if you get an idea
just tell me ;-)
Greetz,
Thomas


Tom Schindl wrote:

> I don't think that focus gained is a good strategy because you receive
> this event when ever an editor is open and closed.

> I'm not sure either how to implement this feature without experimenting
> with the various events.

> Tom

> T. Wilhelm schrieb:
>> Oh iŽm sorry, next time i will use the jface newsgroup.
>> I already used editElement() but the problem is that when i click with
>> my mouse on a special cell, this cell should be edit, not the first one.
>> If i enter the table in another way (i.e. press TAB) then the first cell
>> should be editet.
>> So i had the idea that i implement a check in the focusGained method if
>> the focus was gained by mouse or by Tab, but i couldnt find anything in
>> my event class which could help me :-(
>>
>> Thomas
>>
Previous Topic:Re: NPE upon the invocation of a TableViewer's #setInput() method
Next Topic:Extend ObservableMapCellLabelProvider - Documentation?
Goto Forum:
  


Current Time: Thu Jan 02 20:49:43 GMT 2025

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

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

Back to the top