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 161885 Details for
Bug 305690
Behaviour of mouse events when Control has popup (context) menu set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Sample code
Application_2.java (text/plain), 1.34 KB, created by
Alexander Mitin
on 2010-03-12 10:00:59 EST
(
hide
)
Description:
Sample code
Filename:
MIME Type:
Creator:
Alexander Mitin
Created:
2010-03-12 10:00:59 EST
Size:
1.34 KB
patch
obsolete
>package test; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.MouseAdapter; >import org.eclipse.swt.events.MouseEvent; >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 Application_2 { > > protected Shell shell; > > /** > * Launch the application. > * > * @param args > */ > public static void main(String[] args) { > try { > Application_2 window = new Application_2(); > window.open(); > } catch (Exception e) { > e.printStackTrace(); > } > } > > /** > * Open the window. > */ > public void open() { > Display display = Display.getDefault(); > createContents(); > shell.open(); > shell.layout(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > } > > /** > * Create contents of the window. > */ > protected void createContents() { > shell = new Shell(); > shell.addMouseListener(new MouseAdapter() { > @Override > public void mouseUp(MouseEvent e) { > System.out.println("UP!"); > } > > @Override > public void mouseDown(MouseEvent e) { > System.out.println("Down!"); > } > }); > shell.setSize(450, 300); > shell.setText("SWT Application"); > > Menu menu = new Menu(shell); > shell.setMenu(menu); > > MenuItem menuItem = new MenuItem(menu, SWT.CHECK); > menuItem.setText("New CheckBox"); > } >}
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 305690
: 161885