Suggested way to add double click behavior to table [message #754829] |
Fri, 04 November 2011 10:05  |
Eclipse User |
|
|
|
What is the suggested way to a add double click listener to a table? Currently, I'm adding a SelectionListener and put the code into the widgetDefaultSelected method. Unfortunately, this catches pressing Enter as well. Even when having a TraverseListener registered to catch the SWT.TRAVERSE_RETURN event and setting
e.doit = false;
e.detail = SWT.TRAVERSE_NONE;
in the TraverseListener's keyTraversed method causes the widgetDefaultSelected method to be invoked.
Tom
|
|
|
|
Re: Suggested way to add double click behavior to table [message #755501 is a reply to message #755374] |
Tue, 08 November 2011 11:36  |
Eclipse User |
|
|
|
Yes, or at the swt level, a listener for MouseDoubleClick is the only
way to conclusively know that a double-click occurred.
Grant
On 11/8/2011 5:01 AM, Daniel Krügler wrote:
> On 2011-11-04 15:05, Thomas Singer wrote:
>> What is the suggested way to a add double click listener to a table?
>> Currently, I'm adding a SelectionListener and put the code into the
>> widgetDefaultSelected method. Unfortunately, this catches pressing Enter
>> as well. Even when having a TraverseListener registered to catch the
>> SWT.TRAVERSE_RETURN event and setting
>>
>> e.doit = false;
>> e.detail = SWT.TRAVERSE_NONE;
>>
>> in the TraverseListener's keyTraversed method causes the
>> widgetDefaultSelected method to be invoked.
>
> Why are you not adding an IDoubleClickListener to the viewer?
>
> HTH & Greetings from Bremen,
>
> Daniel Krügler
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03748 seconds