@Override public Rectangle computeTrim() { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); addInternalTrim(trim); return trim; }
@Override public Rectangle computeTrim() { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); addInternalTrim(trim); return trim; }
@Override public Rectangle computeTrim() { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); addInternalTrim(trim); return trim; }
@Override public Rectangle computeTrim() { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); addInternalTrim(trim); return trim; }
@Override public Rectangle computeTrim() { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); addInternalTrim(trim); return trim; }
/** * Computes the trim (status text and tool bar are considered as trim). * Subclasses can extend this method to add additional trim (e.g. scroll * bars for resizable information controls). * * @see org.eclipse.jface.text.IInformationControlExtension3#computeTrim() */ @Override public Rectangle computeTrim() { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); if (fStatusComposite != null) trim.height+= fStatusComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; return trim; }
/** * Computes the trim (status text and tool bar are considered as trim). * Subclasses can extend this method to add additional trim (e.g. scroll * bars for resizable information controls). * * @see org.eclipse.jface.text.IInformationControlExtension3#computeTrim() */ @Override public Rectangle computeTrim() { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); if (fStatusComposite != null) trim.height+= fStatusComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; return trim; }
public void setLocation(Point location) { Rectangle trim = fShell.computeTrim(0, 0, 0, 0); Point textLocation = fComposite.getLocation(); location.x += trim.x - textLocation.x; location.y += trim.y - textLocation.y; fShell.setLocation(location); }
public void setLocation(Point location) { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); Point textLocation= fText.getLocation(); location.x += trim.x - textLocation.x; location.y += trim.y - textLocation.y; fShell.setLocation(location); }
@Override public void setLocation(Point location) { Rectangle trim = mShell.computeTrim(0, 0, 0, 0); Point textLocation = mControl.getLocation(); location.x += trim.x - textLocation.x; location.y += trim.y - textLocation.y; mShell.setLocation(location); }
@Override public void setLocation(Point location) { Rectangle trim = fShell.computeTrim(0, 0, 0, 0); Point textLocation = fText.getLocation(); location.x += trim.x - textLocation.x; location.y += trim.y - textLocation.y; fShell.setLocation(location); }
public void setLocation(Point location) { Rectangle trim = fShell.computeTrim(0, 0, 0, 0); Point textLocation = fComposite.getLocation(); location.x += trim.x - textLocation.x; location.y += trim.y - textLocation.y; fShell.setLocation(location); }
@Override protected Point computeLocation(Rectangle subjectArea, Point controlSize, Anchor anchor) { Point location= super.computeLocation(subjectArea, controlSize, anchor); /* * The location is computed using subjectControl.toDisplay(), which does not include the * trim of the subject control. As we want the additional info popup aligned with the outer * coordinates of the proposal popup, adjust this here */ Rectangle trim= fProposalTable.getShell().computeTrim(0, 0, 0, 0); location.x += trim.x; location.y += trim.y; return location; }
@Override protected Point computeLocation(Rectangle subjectArea, Point controlSize, Anchor anchor) { Point location= super.computeLocation(subjectArea, controlSize, anchor); /* * The location is computed using subjectControl.toDisplay(), which does not include the * trim of the subject control. As we want the additional info popup aligned with the outer * coordinates of the proposal popup, adjust this here */ Rectangle trim= fProposalTable.getShell().computeTrim(0, 0, 0, 0); location.x += trim.x; location.y += trim.y; return location; }
@Override public Point computeSizeHint() { Point preferedSize= getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true); Point constrains= getSizeConstraints(); if (constrains == null) return preferedSize; int trimWidth= getShell().computeTrim(0, 0, 0, 0).width; Point constrainedSize= getShell().computeSize(constrains.x - trimWidth, SWT.DEFAULT, true); int width= Math.min(preferedSize.x, constrainedSize.x); int height= Math.max(preferedSize.y, constrainedSize.y); return new Point(width, height); }
@Override public Point computeSizeHint() { Point preferedSize= getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true); Point constrains= getSizeConstraints(); if (constrains == null) return preferedSize; int trimWidth= getShell().computeTrim(0, 0, 0, 0).width; Point constrainedSize= getShell().computeSize(constrains.x - trimWidth, SWT.DEFAULT, true); int width= Math.min(preferedSize.x, constrainedSize.x); int height= Math.max(preferedSize.y, constrainedSize.y); return new Point(width, height); }
public Overlay(Shell shell) { baseShell = shell; Rectangle cr = baseShell.getClientArea(); Rectangle trim = baseShell.computeTrim(cr.x, cr.y, cr.width, cr.height); offsetX = -trim.x; offsetY = -trim.y; overlayShell = new Shell(baseShell, SWT.NO_TRIM | SWT.ON_TOP); overlayShell.setBounds(baseShell.getBounds()); overlayShell.setBackground(baseShell.getDisplay().getSystemColor( SWT.COLOR_DARK_GREEN)); overlayShell.setAlpha(128); blue = new Color(baseShell.getDisplay(), 0, 0, 128); overlayShell.addPaintListener(new PaintListener() { public void paintControl(PaintEvent e) { e.gc.setForeground(blue); e.gc.setBackground(blue); for (Adornment adornment : adornments) { adornment.drawAdornment(e.gc); } } }); }
Rectangle trim= fShell.computeTrim(0, 0, width, height); int x= toolbarBounds.x + toolbarBounds.width + 2 + trim.x - imageBoundsX; if (!isLTR())
Rectangle trim= fShell.computeTrim(0, 0, width, height); int x= toolbarBounds.x + toolbarBounds.width + 2 + trim.x - imageBoundsX; if (!isLTR())
public Overlay(Shell shell) { baseShell = shell; Rectangle cr = baseShell.getClientArea(); Rectangle trim = baseShell.computeTrim(cr.x, cr.y, cr.width, cr.height); offsetX = -trim.x; offsetY = -trim.y; overlayShell = new Shell(baseShell, SWT.NO_TRIM | SWT.ON_TOP); overlayShell.setBounds(baseShell.getBounds()); overlayShell.setBackground(baseShell.getDisplay().getSystemColor( SWT.COLOR_DARK_GREEN)); overlayShell.setAlpha(128); blue = new Color(baseShell.getDisplay(), 0, 0, 128); overlayShell.addPaintListener(e -> { e.gc.setForeground(blue); e.gc.setBackground(blue); for (Adornment adornment : adornments) { adornment.drawAdornment(e.gc); } }); }