Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 208247 Details for
Bug 366369
widgetDefaultSelected Event not fired cause of disabled default Button
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Snippet
Snippet.java (text/x-java), 1.77 KB, created by
Michael Seele
on 2011-12-12 05:21:54 EST
(
hide
)
Description:
Snippet
Filename:
MIME Type:
Creator:
Michael Seele
Created:
2011-12-12 05:21:54 EST
Size:
1.77 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.layout.RowLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Combo; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.widgets.Listener; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Text; > >public class Snippet { > > public static void main(String[] args) { > Display display = new Display(); > final Shell shell = new Shell(display); > shell.setLayout(new RowLayout()); > final Button button = new Button(shell, SWT.PUSH); > button.setText("Default"); //$NON-NLS-1$ > button.setEnabled(false); > shell.setDefaultButton(button); > Combo combo = new Combo(shell, SWT.NONE); > combo.setItems(new String[] { "A-1", "B-1", "C-1" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > Text text = new Text(shell, SWT.SINGLE | SWT.BORDER); > text.setText("some text"); //$NON-NLS-1$ > final Button enabledDisableDefault = new Button(shell, SWT.CHECK); > enabledDisableDefault.setText("Enable/Disable Default"); //$NON-NLS-1$ > enabledDisableDefault.addListener(SWT.Selection, new Listener() { > @Override > public void handleEvent(Event e) { > shell.setDefaultButton(enabledDisableDefault.getSelection() ? button : null); > } > }); > combo.addListener(SWT.DefaultSelection, new Listener() { > @Override > public void handleEvent(Event e) { > System.out.println(e.widget + " - Default Selection"); //$NON-NLS-1$ > } > }); > text.addListener(SWT.DefaultSelection, new Listener() { > @Override > public void handleEvent(Event e) { > System.out.println(e.widget + " - Default Selection"); //$NON-NLS-1$ > } > }); > shell.pack(); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 366369
: 208247