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 236200 Details for
Bug 418887
[Menu] Menu is activated if a mnemonic is used to create a shell
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
MnemonicMenuAndPopupBug.java (text/x-java), 2.31 KB, created by
Tim Buschtoens
on 2013-10-08 04:37:34 EDT
(
hide
)
Description:
Snippet
Filename:
MIME Type:
Creator:
Tim Buschtoens
Created:
2013-10-08 04:37:34 EDT
Size:
2.31 KB
patch
obsolete
>package snippets; > >import org.eclipse.rap.rwt.RWT; >import org.eclipse.rap.rwt.application.AbstractEntryPoint; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >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 MnemonicMenuAndPopupBug extends AbstractEntryPoint { > > @Override > protected void createContents(Composite parent) { > parent.setLayout(new GridLayout(2, false)); > > Display.getCurrent().setData(RWT.MNEMONIC_ACTIVATOR, "CTRL+ALT"); > > final Button button1 = new Button(parent, SWT.PUSH); > button1.setText("&Button 1"); > > createMenu(parent.getShell()); > > button1.addSelectionListener(new SelectionAdapter() { > > @Override > public void widgetSelected(SelectionEvent e) { > System.out.println("button 1 pressed"); > openPopup(); > } > > private void openPopup() { > final Shell popup = new Shell(Display.getCurrent()); > popup.setLayout(new GridLayout(1, false)); > > Button button = new Button(popup, SWT.PUSH); > button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false)); > button.setText("&Close"); > > button.addSelectionListener(new SelectionAdapter() { > > @Override > public void widgetSelected(SelectionEvent e) { > popup.close(); > } > }); > > popup.pack(); > popup.setLocation(100, 100); > popup.open(); > > } > }); > > } > > private void createMenu(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); > > MenuItem item = new MenuItem(submenu, SWT.PUSH); > item.setText("Select &All\tCtrl+A"); > } > >}
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 418887
: 236200