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 137268 Details for
Bug 240529
Table.getItem(Point) returns null when table size is too small
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Snippet
GetTableItemSize.java (text/plain), 1.54 KB, created by
Carolyn MacLeod
on 2009-05-27 00:42:27 EDT
(
hide
)
Description:
Snippet
Filename:
MIME Type:
Creator:
Carolyn MacLeod
Created:
2009-05-27 00:42:27 EDT
Size:
1.54 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.widgets.*; > >public class GetTableItemSize { > public static void main(String[] args) { > Display display = new Display(); > final Shell shell = new Shell(); > shell.setSize(100, 100); > final Table table = new Table(shell, SWT.NONE); > table.setSize(15, 15); > final TableItem tableItem = new TableItem(table, SWT.NONE); > tableItem.setText("abc"); > table.addListener(SWT.MouseDown, new Listener() { > public void handleEvent(Event e) { > System.out.println("\nShell bounds: " + shell.getBounds()); > System.out.println("Table bounds: " + table.getBounds()); > System.out.println("TableItem bounds: " + tableItem.getBounds()); > System.out.println("Mouse point: " + new Point(e.x, e.y)); > System.out.println("Item at mouse point: " + table.getItem(new Point(e.x, e.y))); > System.out.println("TableItem center point: " + centerPoint(tableItem.getBounds())); > System.out.println("Item at tableItem center point: " + table.getItem(centerPoint(tableItem.getBounds()))); > } > }); > shell.addListener(SWT.MouseDown, new Listener() { > public void handleEvent(Event e) { > table.setSize(100, 100); > } > }); > shell.open(); > > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) display.sleep(); > } > display.dispose(); > } > > private static Point centerPoint(Rectangle boundingRectangle) { > return new Point(boundingRectangle.x + boundingRectangle.width / 2, > boundingRectangle.y + boundingRectangle.height / 2); > } >}
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 240529
:
107695
| 137268