Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » (no subject)
(no subject) [message #715799] Mon, 15 August 2011 15:16 Go to next message
Eclipse User
Originally posted by: Thomas Barth

Hi,
is it possible to get a doubleclick on TabFolder? I would like to give
the user the possibility to edit the text titles of the tabs.

tabFolder.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {

switch (e.type) {

//no other event than SWT.Selection!
case SWT.Selection:
Report.print("Tabfolder selection - never occur");

tabindex = tabFolder.getSelectionIndex();
showTextModules();

break;

case SWT.MouseDoubleClick:
Report.print("Tabfolder doubleclick selection - never occur");
break;

default:
Report.print("? - never occur");

}
}
});

:tested on Linux Ubuntu 10.04


Thomas B
Re: (no subject) [message #716110 is a reply to message #715799] Tue, 16 August 2011 13:26 Go to previous message
Lakshmi Shanmugam
Messages: 274
Registered: July 2009
Location: India
Senior Member
Hi,

In your snippet you have added a listener to the Selection event only. You need to add a listener to listen to the double click event.
tabFolder.addListener(SWT.MouseDoubleClick, new Listener() {
...
});
You can use the same listener for multiple events, if you wish. See this snippet for an example --> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet324.java


Lakshmi P Shanmugam
Previous Topic:(no subject)
Next Topic:OS X: native radio-style toolbar buttons
Goto Forum:
  


Current Time: Wed Sep 17 05:55:38 GMT 2014

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

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