size = text.computeSize( size.x, SWT.DEFAULT ); editor.horizontalAlignment = SWT.LEFT; Rectangle itemRect = item.getBounds(), rect = wTree.getClientArea(); editor.minimumWidth = Math.max( size.x, itemRect.width ) + inset * 2;
size = text.computeSize( size.x, SWT.DEFAULT ); editor.horizontalAlignment = SWT.LEFT; Rectangle itemRect = item.getBounds(), rect = wTree.getClientArea(); editor.minimumWidth = Math.max( size.x, itemRect.width ) + inset * 2;
size = text.computeSize( size.x, SWT.DEFAULT ); editor.horizontalAlignment = SWT.LEFT; Rectangle itemRect = item.getBounds(), rect = wTree.getClientArea(); editor.minimumWidth = Math.max( size.x, itemRect.width ) + inset * 2;
protected TreeItem searchMouseOverTreeItem( TreeItem[] treeItems, int x, int y ) { for ( TreeItem treeItem : treeItems ) { if ( treeItem.getBounds().contains( x, y ) ) { return treeItem; } if ( treeItem.getItemCount() > 0 ) { treeItem = searchMouseOverTreeItem( treeItem.getItems(), x, y ); if ( treeItem != null ) { return treeItem; } } } return null; }
@Override public Rectangle getBounds() { return item.getBounds(); }
protected TreeItem getTreeItemOnRow(int px, int py) { TreeItem result = null; List list = getItemList(); for (Iterator i = list.iterator(); i.hasNext();) { TreeItem item = (TreeItem) i.next(); Rectangle r = item.getBounds(); if ((r != null) && (px >= r.x) && (py >= r.y) && (py <= r.y + r.height)) { result = item; } } return result; }
/** * Returns the bounds of the given item, or <code>null</code> if it is not a * valid type of item. */ private Rectangle getBounds(Item item) { if (item instanceof TreeItem) return ((TreeItem) item).getBounds(); if (item instanceof TableItem) return ((TableItem) item).getBounds(0); return null; }
/** * @param event * Event * @return Returns the {@link Rectangle} describing the bounds of a cell for an event. */ private Rectangle getViewerCellBounds(Event event) { if (event.item instanceof TableItem) { return ((TableItem) event.item).getBounds(event.index); } else if (event.item instanceof TreeItem) { return ((TreeItem) event.item).getBounds(event.index); } throw new RuntimeException("ImageFixStyledCellIndexLabelProvider can only run with tree or table"); }
Rectangle getTextBoundsInPixels (int index) { if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED); RECT rect = getBounds (index, true, false, true); if (index == 0) rect.left += Tree.INSET - 1; rect.left = Math.min (rect.left, rect.right); rect.right = rect.right - Tree.INSET; int width = Math.max (0, rect.right - rect.left); int height = Math.max (0, rect.bottom - rect.top); return new Rectangle (rect.left, rect.top, width, height); }
private void repaintItem(TreeItem item) { Rectangle bounds = item.getBounds(); item.getParent().redraw(bounds.x, bounds.y, bounds.width, bounds.height, false); }
void _resize() { if (row == null) { setBounds(-200, -200, 0, 0); } else { int columnIndex = column == null ? 0 : tree.indexOf(column); setBounds(row.getBounds(columnIndex)); } }
void _resize() { if (row == null) { setBounds(-200, -200, 0, 0); } else { int columnIndex = column == null ? 0 : tree.indexOf(column); setBounds(row.getBounds(columnIndex)); } }
Rectangle getBoundsInPixels () { if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED); RECT rect = getBounds (0, true, false, false); int width = rect.right - rect.left, height = rect.bottom - rect.top; return new Rectangle (rect.left, rect.top, width, height); }
void _resize() { if (row == null) { setBounds(-200, -200, 0, 0); } else { int columnIndex = column == null ? 0 : tree.indexOf(column); setBounds(row.getBounds(columnIndex)); } }
Rectangle getImageBoundsInPixels (int index) { if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED); RECT rect = getBounds (index, false, true, false); int width = rect.right - rect.left, height = rect.bottom - rect.top; return new Rectangle (rect.left, rect.top, width, height); }
Rectangle getBoundsInPixels (int index) { if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED); RECT rect = getBounds (index, true, true, true); int width = rect.right - rect.left, height = rect.bottom - rect.top; return new Rectangle (rect.left, rect.top, width, height); }
void redraw (int column, boolean drawText, boolean drawImage) { if (parent.currentItem == this || !parent.getDrawing ()) return; int /*long*/ hwnd = parent.handle; if (!OS.IsWindowVisible (hwnd)) return; boolean fullImage = column == 0 && drawText && drawImage; RECT rect = getBounds (column, drawText, drawImage, true, fullImage, true, 0); OS.InvalidateRect (hwnd, rect, true); }
@Override protected Item getItemAt(Point p) { TreeItem[] selection = tree.getSelection(); if( selection.length == 1 ) { int columnCount = tree.getColumnCount(); for( int i = 0; i < columnCount; i++ ) { if( selection[0].getBounds(i).contains(p) ) { return selection[0]; } } } return getTree().getItem(p); }
protected Item getItemAt(Point p) { TreeItem[] selection = tree.getSelection(); if( selection.length == 1 ) { int columnCount = tree.getColumnCount(); for( int i = 0; i < columnCount; i++ ) { if( selection[0].getBounds(i).contains(p) ) { return selection[0]; } } } return getTree().getItem(p); }
@Override protected Item getItemAt(Point p) { TreeItem[] selection = tree.getSelection(); if( selection.length == 1 ) { int columnCount = tree.getColumnCount(); for( int i = 0; i < columnCount; i++ ) { if( selection[0].getBounds(i).contains(p) ) { return selection[0]; } } } return getTree().getItem(p); }