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 268625 Details for
Bug 517414
Missing result TabFolder#getItem(Point)
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 for reproduce
Main.java (text/x-java), 2.17 KB, created by
Pavel Matveev
on 2017-05-30 05:59:30 EDT
(
hide
)
Description:
Test for reproduce
Filename:
MIME Type:
Creator:
Pavel Matveev
Created:
2017-05-30 05:59:30 EDT
Size:
2.17 KB
patch
obsolete
>package tests; > >import org.eclipse.jface.window.DefaultToolTip; >import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.Point; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.widgets.Label; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.TabFolder; >import org.eclipse.swt.widgets.TabItem; > >public class Main { > > public static void main(String[] aArgs) { > Display d = new Display(); > Shell sh = new Shell(d); > sh.setLayout(new GridLayout()); > TabFolder tf = new TabFolder(sh, SWT.BORDER | SWT.TOP); > tf.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > createTabItem(tf, "tab item no 0", "scroll to last tab", "tooltip for first tab!!!!"); > for (int i = 1; i < 20; i++) { > createTabItem(tf, "tab item no " + i, "scroll to last tab", "tab item no " + i); > } > createTabItem(tf, "last tab", "hover mouse on first visible", "last tab"); > > new DefaultToolTip(tf) { > > @Override > protected String getText(Event aEvent) { > TabItem item = tf.getItem(new Point(aEvent.x, aEvent.y)); > return (item == null ? null : item.getToolTipText()); > } > > @Override > protected boolean shouldCreateToolTip(Event aEvent) { > return getText(aEvent) != null; > } > > }; > > sh.open(); > while (!sh.isDisposed()) { > d.readAndDispatch(); > } > } > > private static void createTabItem(TabFolder aTabFolder, String aText, String aContentText, > String aTooltip) { > TabItem item = new TabItem(aTabFolder, SWT.NONE); > item.setText(aText); > item.setToolTipText(aTooltip); > Composite content = new Composite(aTabFolder, SWT.NONE); > content.setLayout(new GridLayout()); > Label l = new Label(content, SWT.NONE); > l.setText(aContentText); > l.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true)); > item.setControl(content); > } > >}
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 517414
: 268625 |
268626
|
268627