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 181485 Details for
Bug 328437
MenuItem with RADIO style doesn't pass selection event to it's listeners
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 that works for me
ApplicationTesterEntryPoint.java (text/plain), 1.87 KB, created by
Ivan Furnadjiev
on 2010-10-22 06:53:11 EDT
(
hide
)
Description:
Snippet that works for me
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2010-10-22 06:53:11 EDT
Size:
1.87 KB
patch
obsolete
>package rap.bugs.entrypoint; > >import org.eclipse.rwt.lifecycle.IEntryPoint; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Menu; >import org.eclipse.swt.widgets.MenuItem; >import org.eclipse.swt.widgets.Shell; > >public class ApplicationTesterEntryPoint implements IEntryPoint { > > private void createContents( final Composite parent ) { > parent.setLayout( new GridLayout() ); > } > > private void createMenu( final Shell shell ) { > Menu bar = new Menu( shell, SWT.BAR ); > shell.setMenuBar( bar ); > MenuItem fileItem = new MenuItem( bar, SWT.CASCADE ); > fileItem.setText( "&File" ); > Menu submenu = new Menu( shell, SWT.DROP_DOWN ); > fileItem.setMenu( submenu ); > for( int i = 0; i < 4; i++ ) { > MenuItem item = new MenuItem( submenu, SWT.RADIO ); > item.setText( "Item " + i ); > item.addSelectionListener( new SelectionAdapter() { > > public void widgetSelected( SelectionEvent e ) { > MenuItem item = ( MenuItem )e.widget; > if( item.getSelection() ) { > System.out.println( item + " selected" ); > } else { > System.out.println( item + " unselected" ); > } > } > } ); > } > } > > public int createUI() { > Display display = new Display(); > Shell shell = new Shell( display ); > shell.setText( "Application Tester" ); > createContents( shell ); > createMenu( shell ); > shell.setSize( 300, 600 ); > shell.setLocation( 20, 20 ); > shell.open(); > while( !shell.isDisposed() ) { > if( !display.readAndDispatch() ) { > display.sleep(); > } > } > display.dispose(); > return 0; > } >}
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 328437
: 181485