Home » Eclipse Projects » Eclipse Platform » EditingSupport. Events priority.
EditingSupport. Events priority. [message #327815] |
Sun, 04 May 2008 05:12  |
Eclipse User |
|
|
|
Hi All,
I'm concerned with use of editors in TableViewers.
I'm encountering a problem :
Before starting the edition of a cell, I'd want to make actions on
the whole row of this cell (typically, conditionnaly disable the cell
and so forbid the edition).
Unfortunately, it seems that the EditingSupport.getValue method is
reached before the org.eclipse.jface.viewers.SelectionChangedEvent event.
Is it right and is there a way to solve this point ?
Thanks in advance,
Regards,
Richard
|
|
| |
Re: EditingSupport. Events priority. [message #327818 is a reply to message #327816] |
Sun, 04 May 2008 10:12   |
Eclipse User |
|
|
|
Tom Schindl a écrit :
> Yes this is correct because EditingSupport is listening to MouseEvents
> which come before a SelectionEvent.
>
> You could attach your listener to the ColumnViewerEditor which informs
> interested parties about the starting/ending of an editor.
>
> If you only want to disable the cell you can always return false from
> EditingSupport#canEdit.
>
> Tom
>
> Richard Desbiolles schrieb:
>> Hi All,
>>
>> I'm concerned with use of editors in TableViewers.
>>
>> I'm encountering a problem :
>>
>> Before starting the edition of a cell, I'd want to make actions on
>> the whole row of this cell (typically, conditionnaly disable the cell
>> and so forbid the edition).
>> Unfortunately, it seems that the EditingSupport.getValue method is
>> reached before the org.eclipse.jface.viewers.SelectionChangedEvent event.
>>
>> Is it right and is there a way to solve this point ?
>>
>> Thanks in advance,
>>
>> Regards,
>>
>> Richard
>
>
Thanks Tom,
A so quick response on sunday, thank you very much Tom.
I investigate an I'll come back to you for feedback.
Best regards,
Richard
|
|
|
Re: EditingSupport. Events priority. [message #327968 is a reply to message #327818] |
Sat, 10 May 2008 02:59   |
Eclipse User |
|
|
|
Richard Desbiolles a écrit :
> Tom Schindl a écrit :
>> Yes this is correct because EditingSupport is listening to MouseEvents
>> which come before a SelectionEvent.
>>
>> You could attach your listener to the ColumnViewerEditor which informs
>> interested parties about the starting/ending of an editor.
>>
>> If you only want to disable the cell you can always return false from
>> EditingSupport#canEdit.
>>
>> Tom
>>
>> Richard Desbiolles schrieb:
>>> Hi All,
>>>
>>> I'm concerned with use of editors in TableViewers.
>>>
>>> I'm encountering a problem :
>>>
>>> Before starting the edition of a cell, I'd want to make actions on
>>> the whole row of this cell (typically, conditionnaly disable the cell
>>> and so forbid the edition).
>>> Unfortunately, it seems that the EditingSupport.getValue method is
>>> reached before the org.eclipse.jface.viewers.SelectionChangedEvent
>>> event.
>>>
>>> Is it right and is there a way to solve this point ?
>>>
>>> Thanks in advance,
>>>
>>> Regards,
>>>
>>> Richard
>>
>>
>
> Thanks Tom,
>
> A so quick response on sunday, thank you very much Tom.
>
> I investigate an I'll come back to you for feedback.
>
> Best regards,
>
> Richard
Hi Tom,
My goal is to have different behaviours (enable / disable, default
value, ...) for columns depending the current row and values of one or
more 'master columns'. So my first idea was to catch the 'change of row
event' to refreh the state of columns. Like I said, it doesn't work but,
fortunaly, It's very easy to do with the use of EditingSupport.canEdit
(), and it works fine.
Thanks a lot for your help.
I should also want to programmatically create a new row in my table when
the user tries (with TAB) to leave lhe last enabled column in the
last row. Is it possible to catch this event ?
(My activation strategy is :
boolean bStartEdition =
event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL ||
event.eventType == MOUSE_CLICK_SELECTION
|| ( event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
&& ( event.keyCode == SWT.CR || event.character == ' ' ))
|| event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
Best regards,
Richard
|
|
|
Re: EditingSupport. Events priority. [message #328028 is a reply to message #327968] |
Mon, 12 May 2008 15:05   |
Eclipse User |
|
|
|
Richard Desbiolles schrieb:
> Richard Desbiolles a écrit :
>> Tom Schindl a écrit :
>>> Yes this is correct because EditingSupport is listening to
>>> MouseEvents which come before a SelectionEvent.
>>>
>>> You could attach your listener to the ColumnViewerEditor which
>>> informs interested parties about the starting/ending of an editor.
>>>
>>> If you only want to disable the cell you can always return false from
>>> EditingSupport#canEdit.
>>>
>>> Tom
>>>
>>> Richard Desbiolles schrieb:
>>>> Hi All,
>>>>
>>>> I'm concerned with use of editors in TableViewers.
>>>>
>>>> I'm encountering a problem :
>>>>
>>>> Before starting the edition of a cell, I'd want to make actions on
>>>> the whole row of this cell (typically, conditionnaly disable the
>>>> cell and so forbid the edition).
>>>> Unfortunately, it seems that the EditingSupport.getValue method is
>>>> reached before the org.eclipse.jface.viewers.SelectionChangedEvent
>>>> event.
>>>>
>>>> Is it right and is there a way to solve this point ?
>>>>
>>>> Thanks in advance,
>>>>
>>>> Regards,
>>>>
>>>> Richard
>>>
>>>
>>
>> Thanks Tom,
>>
>> A so quick response on sunday, thank you very much Tom.
>>
>> I investigate an I'll come back to you for feedback.
>>
>> Best regards,
>>
>> Richard
>
> Hi Tom,
>
> My goal is to have different behaviours (enable / disable, default
> value, ...) for columns depending the current row and values of one or
> more 'master columns'. So my first idea was to catch the 'change of row
> event' to refreh the state of columns. Like I said, it doesn't work but,
> fortunaly, It's very easy to do with the use of EditingSupport.canEdit
> (), and it works fine.
>
> Thanks a lot for your help.
>
> I should also want to programmatically create a new row in my table when
> the user tries (with TAB) to leave lhe last enabled column in the last
> row. Is it possible to catch this event ?
>
> (My activation strategy is :
> boolean bStartEdition =
> event.eventType ==
> ColumnViewerEditorActivationEvent.TRAVERSAL || event.eventType ==
> MOUSE_CLICK_SELECTION
> || ( event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
> && ( event.keyCode == SWT.CR || event.character == ' ' ))
> || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
>
>
> Best regards,
>
> Richard
>
>
>
I've just answered a similar question on the nebula-newsgroup. There's
no JFace API for this at the moment you'll have to create your own
ColumnViewerEditor-Subclass and overload processTraverseEvent. For
SWT-Table this is not really simple need a lot of reflection to make it
work but it's certainly possible.
This could certainly be a thing we add in 3.5 though.
Tom
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: EditingSupport. Events priority. [message #328071 is a reply to message #328028] |
Tue, 13 May 2008 12:46  |
Eclipse User |
|
|
|
Tom Schindl a écrit :
> Richard Desbiolles schrieb:
>> Richard Desbiolles a écrit :
>>> Tom Schindl a écrit :
>>>> Yes this is correct because EditingSupport is listening to
>>>> MouseEvents which come before a SelectionEvent.
>>>>
>>>> You could attach your listener to the ColumnViewerEditor which
>>>> informs interested parties about the starting/ending of an editor.
>>>>
>>>> If you only want to disable the cell you can always return false
>>>> from EditingSupport#canEdit.
>>>>
>>>> Tom
>>>>
>>>> Richard Desbiolles schrieb:
>>>>> Hi All,
>>>>>
>>>>> I'm concerned with use of editors in TableViewers.
>>>>>
>>>>> I'm encountering a problem :
>>>>>
>>>>> Before starting the edition of a cell, I'd want to make actions
>>>>> on the whole row of this cell (typically, conditionnaly disable the
>>>>> cell and so forbid the edition).
>>>>> Unfortunately, it seems that the EditingSupport.getValue method is
>>>>> reached before the org.eclipse.jface.viewers.SelectionChangedEvent
>>>>> event.
>>>>>
>>>>> Is it right and is there a way to solve this point ?
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> Regards,
>>>>>
>>>>> Richard
>>>>
>>>>
>>>
>>> Thanks Tom,
>>>
>>> A so quick response on sunday, thank you very much Tom.
>>>
>>> I investigate an I'll come back to you for feedback.
>>>
>>> Best regards,
>>>
>>> Richard
>>
>> Hi Tom,
>>
>> My goal is to have different behaviours (enable / disable, default
>> value, ...) for columns depending the current row and values of one or
>> more 'master columns'. So my first idea was to catch the 'change of
>> row event' to refreh the state of columns. Like I said, it doesn't
>> work but, fortunaly, It's very easy to do with the use of
>> EditingSupport.canEdit (), and it works fine.
>>
>> Thanks a lot for your help.
>>
>> I should also want to programmatically create a new row in my table
>> when the user tries (with TAB) to leave lhe last enabled column in
>> the last row. Is it possible to catch this event ?
>>
>> (My activation strategy is :
>> boolean bStartEdition =
>> event.eventType ==
>> ColumnViewerEditorActivationEvent.TRAVERSAL || event.eventType
>> == MOUSE_CLICK_SELECTION
>> || ( event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
>> && ( event.keyCode == SWT.CR || event.character == ' ' ))
>> || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
>>
>>
>> Best regards,
>>
>> Richard
>>
>>
>>
>
> I've just answered a similar question on the nebula-newsgroup. There's
> no JFace API for this at the moment you'll have to create your own
> ColumnViewerEditor-Subclass and overload processTraverseEvent. For
> SWT-Table this is not really simple need a lot of reflection to make it
> work but it's certainly possible.
>
> This could certainly be a thing we add in 3.5 though.
>
> Tom
>
Thanks Tom,
I investigate and come back to you for feedback.
Best regards,
Richard
|
|
|
Goto Forum:
Current Time: Thu May 01 17:13:59 EDT 2025
Powered by FUDForum. Page generated in 0.03602 seconds
|