Widget getItem(Tree tree, int x, int y) { Point point = new Point(x, y); point = tree.toControl(point); TreeItem item = tree.getItem(point); if (item == null) { Rectangle area = tree.getClientArea(); if (area.contains(point)) { int treeBottom = area.y + area.height; item = tree.getTopItem(); while (item != null) { Rectangle rect = item.getBounds(); int itemBottom = rect.y + rect.height; if (rect.y <= point.y && point.y < itemBottom) return item; if (itemBottom > treeBottom) break; item = nextItem(tree, item); } return null; } } return item; }
Widget getItem(Tree tree, int x, int y) { Point point = new Point(x, y); point = tree.toControl(point); TreeItem item = tree.getItem(point); if (item == null) { Rectangle area = tree.getClientArea(); if (area.contains(point)) { int treeBottom = area.y + area.height; item = tree.getTopItem(); while (item != null) { Rectangle rect = item.getBounds(); int itemBottom = rect.y + rect.height; if (rect.y <= point.y && point.y < itemBottom) return item; if (itemBottom > treeBottom) break; item = nextItem(tree, item); } return null; } } return item; }
Widget getItem(Tree tree, int x, int y) { Point point = new Point(x, y); point = tree.toControl(point); TreeItem item = tree.getItem(point); if (item == null) { Rectangle area = tree.getClientArea(); if (area.contains(point)) { int treeBottom = area.y + area.height; item = tree.getTopItem(); while (item != null) { Rectangle rect = item.getBounds(); int itemBottom = rect.y + rect.height; if (rect.y <= point.y && point.y < itemBottom) return item; if (itemBottom > treeBottom) break; item = nextItem(tree, item); } return null; } } return item; }
Widget getItem(Tree tree, int x, int y) { Point point = new Point(x, y); point = tree.toControl(point); TreeItem item = tree.getItem(point); if (item == null) { Rectangle area = tree.getClientArea(); if (area.contains(point)) { int treeBottom = area.y + area.height; item = tree.getTopItem(); while (item != null) { Rectangle rect = item.getBounds(); int itemBottom = rect.y + rect.height; if (rect.y <= point.y && point.y < itemBottom) return item; if (itemBottom > treeBottom) break; item = nextItem(tree, item); } return null; } } return item; }
Widget getItem(Tree tree, int x, int y) { Point point = new Point(x, y); point = tree.toControl(point); TreeItem item = tree.getItem(point); if (item == null) { Rectangle area = tree.getClientArea(); if (area.contains(point)) { int treeBottom = area.y + area.height; item = tree.getTopItem(); while (item != null) { Rectangle rect = item.getBounds(); int itemBottom = rect.y + rect.height; if (rect.y <= point.y && point.y < itemBottom) return item; if (itemBottom > treeBottom) break; item = nextItem(tree, item); } return null; } } return item; }
Widget getItem(Tree tree, int x, int y) { Point point = new Point(x, y); point = tree.toControl(point); TreeItem item = tree.getItem(point); if (item == null) { Rectangle area = tree.getClientArea(); if (area.contains(point)) { int treeBottom = area.y + area.height; item = tree.getTopItem(); while (item != null) { Rectangle rect = item.getBounds(); int itemBottom = rect.y + rect.height; if (rect.y <= point.y && point.y < itemBottom) return item; if (itemBottom > treeBottom) break; item = nextItem(tree, item); } return null; } } return item; }