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 119839 Details for
Bug 257986
[JFace] The cursor cannot enter a tooltip with a positive offset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Snippet to demonstrate problem
257986.txt (text/plain), 3.09 KB, created by
Matthew Bisson
on 2008-12-08 16:28:40 EST
(
hide
)
Description:
Snippet to demonstrate problem
Filename:
MIME Type:
Creator:
Matthew Bisson
Created:
2008-12-08 16:28:40 EST
Size:
3.09 KB
patch
obsolete
>import org.eclipse.jface.viewers.ArrayContentProvider; >import org.eclipse.jface.viewers.CheckboxTableViewer; >import org.eclipse.jface.window.ToolTip; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.events.SelectionListener; >import org.eclipse.swt.graphics.Point; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.widgets.Link; >import org.eclipse.swt.widgets.Shell; > >/** > * Demonstrates the need to move a tooltip. > * > * This example has a table. When you hover over a table item, a tooltip > * appears. The tooltip has a link - try to click it. > * > * When the tooltip is in its original position, you cannot move the cursor > * over the tooltip. > * > * When the tooltip is moved to be under the mouse to allow you to click the > * link in the tooltip, you cannot click the tree (e.g. try hovering over the > * checkbox, then wait for the tooltip to appear, then try to click the > * checkbox). > * > * Change which problem you want to simulate with the MODE constant below. > * > * @author mrbisson > * > */ >public class Snippet { > > /** > * Keeps the tooltip in its default position. > * Problem: the user cannot move his mouse over the tooltip. > */ > private static final int ORIGINAL_POSITION = 1; > > /** > * Moves the tooltip over the cursor. > * Problem: the user cannot click the item below the cursor. > */ > private static final int MOVED_POSITION = 2; > > /** > * Either ORIGINAL_POSITION or MOVED_POSITION to simulate the different > * problems. > */ > private static final int MODE = MOVED_POSITION; > > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new FillLayout()); > > Composite composite = new Composite(shell, SWT.NONE); > composite.setLayout(new FillLayout()); > > final CheckboxTableViewer tableViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER); > tableViewer.setContentProvider(new ArrayContentProvider()); > > tableViewer.setInput(new String[] {"mercury", "venus", "earth", "mars", "jupiter", "saturn", "neptune", "uranus"}); > > ToolTip toolTip = new ToolTip(tableViewer.getTable()) { > @Override > protected Composite createToolTipContentArea(final Event event, Composite parent) { > Link link = new Link(parent, SWT.NONE); > > link.setText("<a>Click me</a>"); > > link.addSelectionListener(new SelectionListener() { > public void widgetDefaultSelected(SelectionEvent e) { > System.out.println("Hello World!"); > } > public void widgetSelected(SelectionEvent e) { > widgetDefaultSelected(e); > } > }); > > return parent; > } > }; > > > toolTip.setHideOnMouseDown(false); > > if(MODE == MOVED_POSITION) { > toolTip.setShift(new Point(0, 0)); > } > > shell.setSize (200, 200); > shell.open (); > 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 257986
: 119839 |
119841