protected Point getAboveLocation(Shell shell, int offset) { StyledText text= fViewer.getTextWidget(); Point location= text.getLocationAtOffset(offset); location= text.toDisplay(location); Rectangle shellBounds= shell.getBounds(); Rectangle displayBounds= shell.getDisplay().getClientArea(); location.y=location.y - shellBounds.height; shiftHorizontalLocation(location, shellBounds, displayBounds); shiftVerticalLocation(location, shellBounds, displayBounds); return location; }
protected Point getStackedLocation(Shell shell, Shell parent) { Point p= parent.getLocation(); Point size= parent.getSize(); p.x += size.x / 4; p.y += size.y; p= parent.toDisplay(p); Rectangle shellBounds= shell.getBounds(); Rectangle displayBounds= shell.getDisplay().getClientArea(); shiftHorizontalLocation(p, shellBounds, displayBounds); shiftVerticalLocation(p, shellBounds, displayBounds); return p; }
protected Point getStackedLocation(Shell shell, Shell parent) { Point p= parent.getLocation(); Point size= parent.getSize(); p.x += size.x / 4; p.y += size.y; p= parent.toDisplay(p); Rectangle shellBounds= shell.getBounds(); Rectangle displayBounds= shell.getDisplay().getClientArea(); shiftHorizontalLocation(p, shellBounds, displayBounds); shiftVerticalLocation(p, shellBounds, displayBounds); return p; }
protected Point getBelowLocation(Shell shell, int offset) { StyledText text= fViewer.getTextWidget(); Point location= text.getLocationAtOffset(offset); if (location.x < 0) location.x= 0; if (location.y < 0) location.y= 0; location= text.toDisplay(location); Rectangle shellBounds= shell.getBounds(); Rectangle displayBounds= shell.getDisplay().getClientArea(); location.y= location.y + text.getLineHeight(offset); shiftHorizontalLocation(location, shellBounds, displayBounds); shiftVerticalLocation(location, shellBounds, displayBounds); return location; }
protected Point getAboveLocation(Shell shell, int offset) { StyledText text= fViewer.getTextWidget(); Point location= text.getLocationAtOffset(offset); location= text.toDisplay(location); Rectangle shellBounds= shell.getBounds(); Rectangle displayBounds= shell.getDisplay().getClientArea(); location.y=location.y - shellBounds.height; shiftHorizontalLocation(location, shellBounds, displayBounds); shiftVerticalLocation(location, shellBounds, displayBounds); return location; }
protected Point getBelowLocation(Shell shell, int offset) { StyledText text= fViewer.getTextWidget(); Point location= text.getLocationAtOffset(offset); if (location.x < 0) location.x= 0; if (location.y < 0) location.y= 0; location= text.toDisplay(location); Rectangle shellBounds= shell.getBounds(); Rectangle displayBounds= shell.getDisplay().getClientArea(); location.y= location.y + text.getLineHeight(offset); shiftHorizontalLocation(location, shellBounds, displayBounds); shiftVerticalLocation(location, shellBounds, displayBounds); return location; }