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 219973 Details for
Bug 387423
CLabel mouselistener not working when embedded in Composite
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.
Test code snippet
TestMouseListener.java (text/x-java), 1.71 KB, created by
Andrew
on 2012-08-16 14:34:26 EDT
(
hide
)
Description:
Test code snippet
Filename:
MIME Type:
Creator:
Andrew
Created:
2012-08-16 14:34:26 EDT
Size:
1.71 KB
patch
obsolete
> >import org.eclipse.swt.*; >import org.eclipse.swt.custom.*; >import org.eclipse.swt.events.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > > >public class TestMouseListener { > > /** > * @param args > */ > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new FillLayout()); > > Composite bar = new Composite(shell, SWT.CENTER); > > CLabel mainLabel = new CLabel( bar, SWT.CENTER ); > > IC_MoveBarListener moveBar = new IC_MoveBarListener(); > > mainLabel.addMouseListener(moveBar); > mainLabel.addMouseMoveListener(moveBar); > > shell.setSize(300, 300); > shell.open(); > > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } > > /** > */ > public static class IC_MoveBarListener > extends MouseAdapter > implements MouseMoveListener > { > /** The depressed. */ > private boolean depressed = false; > > @Override > public void mouseDown( MouseEvent e ) > { > System.out.println("mouseDown"); > depressed = true; > } > > @Override > public void mouseUp( MouseEvent e ) > { > System.out.println("mouseUp"); > depressed = false; > } > > @Override > public void mouseMove( MouseEvent e ) > { > if( depressed ) > { > System.out.println("mouse Move IC"); > } > } > } >}
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 387423
: 219973