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 107695 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
Shows getItem(Point) returning null even when given a point over the item's reported client area
GetTableItemSize.java (text/plain), 1.29 KB, created by
Heath Borders
on 2008-07-16 23:54:16 EDT
(
hide
)
Description:
Shows getItem(Point) returning null even when given a point over the item's reported client area
Filename:
MIME Type:
Creator:
Heath Borders
Created:
2008-07-16 23:54:16 EDT
Size:
1.29 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.Point; >import org.eclipse.swt.graphics.Rectangle; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Table; >import org.eclipse.swt.widgets.TableItem; > >public class GetTableItemSize { > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(); > shell.setSize(0, 0); > Table table = new Table(shell, SWT.NONE); > table.setSize(0, 0); > TableItem tableItem = new TableItem(table, SWT.NONE); > > System.out.println("TableItem bounds with shell (0, 0), table (0, 0): " > + tableItem.getBounds()); > > System.out > .println("Get item at tableItem center point with shell (0, 0), table (0, 0): " > + table.getItem(centerPoint(tableItem.getBounds()))); > > table.setSize(100, 100); > > System.out > .println("TableItem bounds with shell (0, 0), table (100, 100): " > + tableItem.getBounds()); > System.out > .println("Get item at tableItem center point with shell (0, 0), table (100, 100): " > + table.getItem(centerPoint(tableItem.getBounds()))); > > } > > 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