Re: Jump into first cell of Table [message #4429] |
Wed, 13 May 2009 05:18  |
Eclipse User |
|
|
|
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 #4846 is a reply to message #4568] |
Thu, 14 May 2009 02:53  |
Eclipse User |
|
|
|
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
>>
|
|
|
Powered by
FUDForum. Page generated in 0.05492 seconds