Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Suggested way to add double click behavior to table
Suggested way to add double click behavior to table [message #754829] Fri, 04 November 2011 14:05 Go to next message
Thomas Singer is currently offline Thomas SingerFriend
Messages: 75
Registered: July 2009
Member
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 #755374 is a reply to message #754829] Tue, 08 November 2011 10:01 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
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
Re: Suggested way to add double click behavior to table [message #755501 is a reply to message #755374] Tue, 08 November 2011 16:36 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
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
>
>
Previous Topic:Unhandled event loop exception
Next Topic:SWT multitouch on Linux?
Goto Forum:
  


Current Time: Fri Apr 19 20:13:21 GMT 2024

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

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

Back to the top