Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsAllow editing of cell in table only on double-click
https://www.eclipse.org/forums/index.php/mv/msg/203890/651901/#msg_651901
I have a table that allows its cells to be modified by the user. The
problem is that the cell becomes editable as soon as the user clicks on
a row which is not desirable: I would prefer that a single-click select
the rows and that a double-click allows to edit the cell. Is that
possible with RAP? It seems that I could prevent editing on a single
click by overrinding ColumnViewerEditorActivationStrategy but in RAP I
don't have the number of time a button was clicked. Am I missing
something simple here?
Thanks for any tips,
Jean Bovet]]>Jean Bovet2011-02-01T23:31:07-00:00Re: Allow editing of cell in table only on double-click
https://www.eclipse.org/forums/index.php/mv/msg/203890/651972/#msg_651972
you have to create your own class that extends
ColumnViewerEditorActivationStrategy and override the method
isEditorActivationEvent.
Look at ColumnViewerEditorActivationStrategy#isEditorActivationEvent and
replace ColumnViewerEditorActivationEvent#MOUSE_CLICK_SELECTION with
ColumnViewerEditorActivationEvent#MOUSE_DOUBLE_CLICK_SELECTI ON. This
should work.
Best,
Ivan
On 2/2/2011 1:31 AM, Jean Bovet wrote:
> Hi,
>
> I have a table that allows its cells to be modified by the user. The
> problem is that the cell becomes editable as soon as the user clicks
> on a row which is not desirable: I would prefer that a single-click
> select the rows and that a double-click allows to edit the cell. Is
> that possible with RAP? It seems that I could prevent editing on a
> single click by overrinding ColumnViewerEditorActivationStrategy but
> in RAP I don't have the number of time a button was clicked. Am I
> missing something simple here?
>
> Thanks for any tips,
>
> Jean Bovet
>]]>Ivan Furnadjiev2011-02-02T10:17:53-00:00Re: Allow editing of cell in table only on double-click
https://www.eclipse.org/forums/index.php/mv/msg/203890/652135/#msg_652135
Jean
On 2011-02-02 02:17:53 -0800, Ivan Furnadjiev said:
> Hi Jean,
> you have to create your own class that extends
> ColumnViewerEditorActivationStrategy and override the method
> isEditorActivationEvent.
> Look at ColumnViewerEditorActivationStrategy#isEditorActivationEvent
> and replace ColumnViewerEditorActivationEvent#MOUSE_CLICK_SELECTION
> with ColumnViewerEditorActivationEvent#MOUSE_DOUBLE_CLICK_SELECTI ON.
> This should work.
> Best,
> Ivan
>
> On 2/2/2011 1:31 AM, Jean Bovet wrote:
>> Hi,
>>
>> I have a table that allows its cells to be modified by the user. The
>> problem is that the cell becomes editable as soon as the user clicks on
>> a row which is not desirable: I would prefer that a single-click select
>> the rows and that a double-click allows to edit the cell. Is that
>> possible with RAP? It seems that I could prevent editing on a single
>> click by overrinding ColumnViewerEditorActivationStrategy but in RAP I
>> don't have the number of time a button was clicked. Am I missing
>> something simple here?
>>
>> Thanks for any tips,
>>
>> Jean Bovet]]>Jean Bovet2011-02-02T17:50:59-00:00