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 238416 Details for
Bug 424275
Mouse click event in a control of shellX is also fired in a widget in shellY which is below shellX
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.
Code to show the triggering of an MouseUp event in the shell below, after closeing the shell above
SwtMouseEffect.java (text/x-java), 2.71 KB, created by
andreas
on 2013-12-17 16:48:29 EST
(
hide
)
Description:
Code to show the triggering of an MouseUp event in the shell below, after closeing the shell above
Filename:
MIME Type:
Creator:
andreas
Created:
2013-12-17 16:48:29 EST
Size:
2.71 KB
patch
obsolete
> >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.MouseEvent; >import org.eclipse.swt.events.MouseListener; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.events.SelectionListener; >import org.eclipse.swt.graphics.Color; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.layout.RowLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Text; > > >public class SwtMouseEffect { > SwtMouseEffect() { > Display display = new Display(); > final Shell shell = new Shell(display); > RowLayout layout = new RowLayout(SWT.VERTICAL); > layout.fill = true; > shell.setLayout(layout); > Button button = new Button(shell, SWT.BORDER); > button.setText("open other shell"); > button.addSelectionListener(new SelectionListener() { > > @Override > public void widgetDefaultSelected(SelectionEvent arg0) { > } > > @Override > public void widgetSelected(SelectionEvent arg0) { > final Shell shell2 = new Shell(); > shell2.setLayout(new FillLayout()); > Composite c = new Composite(shell2, SWT.BORDER); > c.setBackground(new Color(shell2.getDisplay(), 255,0,0)); > c.addMouseListener(new MouseListener() { > > @Override > public void mouseDoubleClick(MouseEvent arg0) { > } > > @Override > public void mouseDown(MouseEvent arg0) { > shell2.close(); > } > > @Override > public void mouseUp(MouseEvent arg0) { > } > > }); > shell2.pack(); > shell2.setLocation(shell.getLocation().x + 20, shell.getLocation().y + 30); > shell2.open(); > } > > }); > Text textWidget = new Text(shell, SWT.BORDER); > textWidget.setText("bla bla bla bla bla bla bla bla"); > textWidget.addMouseListener(new MouseListener() { > int counter = 0; > @Override > public void mouseDoubleClick(MouseEvent arg0) { > } > > @Override > public void mouseDown(MouseEvent arg0) { > } > > @Override > public void mouseUp(MouseEvent e) { > counter++; > ((Text) e.widget).setText("mouse up called: " + counter); > } > > }); > shell.pack(); > shell.open(); > while (!shell.isDisposed ()) { > if (!display.readAndDispatch ()) display.sleep (); > } > display.dispose (); > > > } > > /** > * @param args > */ > public static void main(String[] args) { > new SwtMouseEffect(); > } > >}
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 424275
: 238416