Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » EditingSupport. Events priority.
EditingSupport. Events priority. [message #327815] Sun, 04 May 2008 09:12 Go to next message
Richard Desbiolles is currently offline Richard DesbiollesFriend
Messages: 23
Registered: July 2009
Junior Member
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 #327816 is a reply to message #327815] Sun, 04 May 2008 09:31 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EditingSupport. Events priority. [message #327818 is a reply to message #327816] Sun, 04 May 2008 14:12 Go to previous messageGo to next message
Richard Desbiolles is currently offline Richard DesbiollesFriend
Messages: 23
Registered: July 2009
Junior Member
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 06:59 Go to previous messageGo to next message
Richard Desbiolles is currently offline Richard DesbiollesFriend
Messages: 23
Registered: July 2009
Junior Member
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 19:05 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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 16:46 Go to previous message
Richard Desbiolles is currently offline Richard DesbiollesFriend
Messages: 23
Registered: July 2009
Junior Member
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
Previous Topic:Inserting external library
Next Topic:launch a make in the current project directory
Goto Forum:
  


Current Time: Sat Jul 27 12:30:09 GMT 2024

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

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

Back to the top