@Override public Point getLocation(Point tipSize, Event event) { // try to position the tooltip at the bottom of the cell ViewerCell cell = v.getCell(new Point(event.x, event.y)); if( cell != null ) { return tree.toDisplay(event.x,cell.getBounds().y+cell.getBounds().height); } return super.getLocation(tipSize, event); }
@Override public void update(ViewerCell cell) { // Force a redraw Rectangle cellBounds = cell.getBounds(); cell.getControl().redraw(cellBounds.x, cellBounds.y, cellBounds.width, cellBounds.height, true); }
@Override public void update(ViewerCell cell) { // Force a redraw Rectangle cellBounds = cell.getBounds(); cell.getControl().redraw(cellBounds.x, cellBounds.y, cellBounds.width, cellBounds.height, true); }
@Override public Point getLocation(Point tipSize, Event event) { Widget widget = getTipWidget(event); if (widget != null) { Rectangle bounds = getBounds(widget); if (bounds != null) { if (data instanceof ViewerCell) { bounds = ((ViewerCell) data).getBounds(); } return control.toDisplay(bounds.x + X_SHIFT, bounds.y + bounds.height + Y_SHIFT); } } return super.getLocation(tipSize, event);//control.toDisplay(event.x + xShift, event.y + yShift); }
@Override protected void focusCellChanged(ViewerCell newCell, ViewerCell oldCell) { super.focusCellChanged(newCell, oldCell); // Redraw new area if (newCell != null) { Rectangle rect = newCell.getBounds(); int x = newCell.getColumnIndex() == 0 ? 0 : rect.x; int width = newCell.getColumnIndex() == 0 ? rect.x + rect.width : rect.width; // 1 is a fix for Linux-GTK newCell.getControl().redraw(x, rect.y - 1, width, rect.height + 1, true); } if (oldCell != null) { Rectangle rect = oldCell.getBounds(); int x = oldCell.getColumnIndex() == 0 ? 0 : rect.x; int width = oldCell.getColumnIndex() == 0 ? rect.x + rect.width : rect.width; // 1 is a fix for Linux-GTK oldCell.getControl().redraw(x, rect.y - 1, width, rect.height + 1, true); } } }
@Override protected void focusCellChanged(ViewerCell newCell, ViewerCell oldCell) { super.focusCellChanged(newCell, oldCell); // Redraw new area if (newCell != null) { Rectangle rect = newCell.getBounds(); int x = newCell.getColumnIndex() == 0 ? 0 : rect.x; int width = newCell.getColumnIndex() == 0 ? rect.x + rect.width : rect.width; // 1 is a fix for Linux-GTK newCell.getControl().redraw(x, rect.y - 1, width, rect.height + 1, true); } if (oldCell != null) { Rectangle rect = oldCell.getBounds(); int x = oldCell.getColumnIndex() == 0 ? 0 : rect.x; int width = oldCell.getColumnIndex() == 0 ? rect.x + rect.width : rect.width; // 1 is a fix for Linux-GTK oldCell.getControl().redraw(x, rect.y - 1, width, rect.height + 1, true); } } }
private void removeSelectionInformation(Event event, ViewerCell cell) { GC gc = event.gc; gc.setBackground(cell.getViewerRow().getBackground(cell.getColumnIndex())); gc.setForeground(cell.getViewerRow().getForeground(cell.getColumnIndex())); gc.fillRectangle(cell.getBounds()); event.detail &= ~SWT.SELECTED; }
private void removeSelectionInformation(Event event, ViewerCell cell) { GC gc = event.gc; gc.setBackground(cell.getViewerRow().getBackground( cell.getColumnIndex())); gc.setForeground(cell.getViewerRow().getForeground( cell.getColumnIndex())); gc.fillRectangle(cell.getBounds()); event.detail &= ~SWT.SELECTED; }