List of usage examples for org.eclipse.jface.util Geometry setDimension
public static void setDimension(Rectangle toSet, boolean width, int newCoordinate)
From source file:org.eclipse.ui.internal.FastViewBar.java
License:Open Source License
/** * Returns the approximate location where the next fastview icon * will be drawn (display coordinates)/* w ww .ja v a 2 s . co m*/ */ public Rectangle getLocationOfNextIcon() { ToolBar control = getToolBar(); Rectangle result = control.getBounds(); Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); result.height = size.y; result.width = size.x; boolean horizontal = Geometry.isHorizontal(getSide()); if (control.getItemCount() == 0) { Geometry.setDimension(result, horizontal, 0); } int hoverSide = horizontal ? SWT.RIGHT : SWT.BOTTOM; result = Geometry.getExtrudedEdge(result, -Geometry.getDimension(result, !horizontal), hoverSide); return Geometry.toDisplay(control.getParent(), result); }
From source file:org.eclipse.ui.internal.FastViewDnDHandler.java
License:Open Source License
/** * Returns the approximate location where the next fastview icon * will be drawn (display coordinates)//from w w w . j av a 2s . c o m */ public Rectangle getLocationOfNextIcon() { ToolBar control = tbm.getControl(); Rectangle result = control.getBounds(); Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT, false); result.height = size.y; result.width = size.x; boolean horizontal = (control.getStyle() & SWT.VERTICAL) == 0; if (control.getItemCount() == 0) { Geometry.setDimension(result, horizontal, 0); } int hoverSide = horizontal ? SWT.RIGHT : SWT.BOTTOM; result = Geometry.getExtrudedEdge(result, -Geometry.getDimension(result, !horizontal), hoverSide); return Geometry.toDisplay(control.getParent(), result); }