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 286355 Details for
Bug 573475
ToolBar mouseDown event is fired twice on right click of a toolitem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Snippet demonstrating the behaviour
ToolBarBug.java (text/x-java), 1.53 KB, created by
Christoph Laeubrich
on 2021-05-11 05:36:13 EDT
(
hide
)
Description:
Snippet demonstrating the behaviour
Filename:
MIME Type:
Creator:
Christoph Laeubrich
Created:
2021-05-11 05:36:13 EDT
Size:
1.53 KB
patch
obsolete
>package jface.snippets; > > >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.MouseEvent; >import org.eclipse.swt.events.MouseListener; >import org.eclipse.swt.graphics.Point; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.ToolBar; >import org.eclipse.swt.widgets.ToolItem; > >public class ToolBarBug { > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setText("Toolbar Test"); > shell.setLayout(new GridLayout()); > ToolBar toolBar = new ToolBar(shell, SWT.NONE); > toolBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > toolBar.setBackground(display.getSystemColor(SWT.COLOR_DARK_CYAN)); > ToolItem toolItem2 = new ToolItem(toolBar, SWT.PUSH); > toolItem2.setText(" Button A "); > ToolItem toolItem1 = new ToolItem(toolBar, SWT.PUSH); > toolItem1.setText(" Button B "); > toolBar.addMouseListener(new MouseListener() { > > @Override > public void mouseUp(MouseEvent e) { > > } > > @Override > public void mouseDown(MouseEvent e) { > > System.out.println(toolBar.getItem(new Point(e.x, e.y))); > > } > > @Override > public void mouseDoubleClick(MouseEvent e) { > > } > }); > toolItem1.addListener(SWT.MouseDown, e -> { > System.out.println("Item Mouse down?"); > }); > shell.open(); > shell.setSize(800, 400); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > display.dispose(); > } >}
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 573475
: 286355