public void addEndRect(Control ctrl) { Rectangle ctrlBounds = ctrl.getBounds(); Rectangle endRect = Geometry.toDisplay(ctrl.getParent(), ctrlBounds); addEndRect(endRect); }
public void addStartRect(Control ctrl) { Rectangle ctrlBounds = ctrl.getBounds(); Rectangle startRect = Geometry.toDisplay(ctrl.getParent(), ctrlBounds); addStartRect(startRect); }
/** * Shorthand method. Returns the bounding rectangle for the given control, * in display coordinates. * * @param boundsControl * the control whose bounds are to be computed * @return the bounds of the given control in display coordinates */ public static Rectangle getDisplayBounds(Control boundsControl) { Control parent = boundsControl.getParent(); if (parent == null || boundsControl instanceof Shell) { return boundsControl.getBounds(); } return Geometry.toDisplay(parent, boundsControl.getBounds()); }
/** * Shorthand method. Returns the bounding rectangle for the given control, in * display coordinates. Note that all 'Shell' controls are expected to be 'top level' * so DO NOT do the origin offset for them. * * @param draggedItem * @param boundsControl * @return */ public static Rectangle getDisplayBounds(Control boundsControl) { Control parent = boundsControl.getParent(); if (parent == null || boundsControl instanceof Shell) { return boundsControl.getBounds(); } return Geometry.toDisplay(parent, boundsControl.getBounds()); }
protected IIntroPart closeLaunchBar(boolean restore) { IntroPlugin.getDefault().setLaunchBar(null); // if we've already been removed, this won't hurt us if (trimControl.getParent() != null) { trimControl.getParent().getChildren().remove(trimControl); } IIntroPart intro = null; if (restore) { IWorkbenchWindow window = getWorkbenchWindow(); intro = PlatformUI.getWorkbench().getIntroManager().showIntro(window, false); CustomizableIntroPart cpart = (CustomizableIntroPart) intro; Rectangle startBounds = Geometry.toDisplay(getControl().getParent(), getControl().getBounds()); Rectangle endBounds = Geometry.toDisplay(cpart.getControl().getParent(), cpart.getControl() .getBounds()); AnimationEngine.createTweakedAnimation(window.getShell(), 400, startBounds, endBounds); } dispose(); return intro; }
private void updateVisibility() { if (fPopup != null && !fPopup.isDisposed() && fDelayJobFinished) { boolean visible= false; //TODO: Check for visibility of linked position, not whether popup is outside of editor? if (fRenameLinkedMode.isCaretInLinkedPosition()) { StyledText textWidget= fEditor.getViewer().getTextWidget(); Rectangle eArea= Geometry.toDisplay(textWidget, textWidget.getClientArea()); Rectangle pBounds= fPopup.getBounds(); pBounds.x-= GAP; pBounds.y-= GAP; pBounds.width+= 2 * GAP; pBounds.height+= 2 * GAP; if (eArea.intersects(pBounds)) { visible= true; } } if (visible && ! fPopup.isVisible()) { ISourceViewer viewer= fEditor.getViewer(); if (viewer instanceof IWidgetTokenOwnerExtension) { IWidgetTokenOwnerExtension widgetTokenOwnerExtension= (IWidgetTokenOwnerExtension) viewer; widgetTokenOwnerExtension.requestWidgetToken(this, WIDGET_PRIORITY); } } else if (! visible && fPopup.isVisible()) { releaseWidgetToken(); } fPopup.setVisible(visible); } }
private void updateVisibility() { if (fPopup != null && !fPopup.isDisposed() && fDelayJobFinished) { boolean visible= false; //TODO: Check for visibility of linked position, not whether popup is outside of editor? if (fRenameLinkedMode.isCaretInLinkedPosition()) { StyledText textWidget= fEditor.getViewer().getTextWidget(); Rectangle eArea= Geometry.toDisplay(textWidget, textWidget.getClientArea()); Rectangle pBounds= fPopup.getBounds(); pBounds.x-= GAP; pBounds.y-= GAP; pBounds.width+= 2 * GAP; pBounds.height+= 2 * GAP; if (eArea.intersects(pBounds)) { visible= true; } } if (visible && ! fPopup.isVisible()) { ISourceViewer viewer= fEditor.getViewer(); if (viewer instanceof IWidgetTokenOwnerExtension) { IWidgetTokenOwnerExtension widgetTokenOwnerExtension= (IWidgetTokenOwnerExtension) viewer; visible= widgetTokenOwnerExtension.requestWidgetToken(this, WIDGET_PRIORITY); } } else if (! visible && fPopup.isVisible()) { releaseWidgetToken(); } fPopup.setVisible(visible); } }
private void updateVisibility() { if (fPopup != null && !fPopup.isDisposed() && fDelayJobFinished) { boolean visible= false; //TODO: Check for visibility of linked position, not whether popup is outside of editor? if (fRenameLinkedMode.isCaretInLinkedPosition()) { StyledText textWidget= fEditor.getViewer().getTextWidget(); Rectangle eArea= Geometry.toDisplay(textWidget, textWidget.getClientArea()); Rectangle pBounds= fPopup.getBounds(); pBounds.x-= GAP; pBounds.y-= GAP; pBounds.width+= 2 * GAP; pBounds.height+= 2 * GAP; if (eArea.intersects(pBounds)) { visible= true; } } if (visible && ! fPopup.isVisible()) { ISourceViewer viewer= fEditor.getViewer(); if (viewer instanceof IWidgetTokenOwnerExtension) { IWidgetTokenOwnerExtension widgetTokenOwnerExtension= (IWidgetTokenOwnerExtension) viewer; visible= widgetTokenOwnerExtension.requestWidgetToken(this, WIDGET_PRIORITY); } } else if (! visible && fPopup.isVisible()) { releaseWidgetToken(); } fPopup.setVisible(visible); } }
protected void updateVisibility() { if (popup != null && !popup.isDisposed() && delayJobFinished) { boolean visible = false; if (renameLinkedMode.isCaretInLinkedPosition()) { StyledText textWidget = editor.getInternalSourceViewer().getTextWidget(); Rectangle eArea = Geometry.toDisplay(textWidget, textWidget.getClientArea()); Rectangle pBounds = popup.getBounds(); pBounds.x -= GAP; pBounds.y -= GAP; pBounds.width += 2 * GAP; pBounds.height += 2 * GAP; if (eArea.intersects(pBounds)) { visible = true; } } if (visible && !popup.isVisible()) { ISourceViewer viewer = editor.getInternalSourceViewer(); if (viewer instanceof IWidgetTokenOwnerExtension) { IWidgetTokenOwnerExtension widgetTokenOwnerExtension = (IWidgetTokenOwnerExtension) viewer; widgetTokenOwnerExtension.requestWidgetToken(this, WIDGET_PRIORITY); } } else if (!visible && popup.isVisible()) { releaseWidgetToken(); } popup.setVisible(visible); } }
private boolean switchToLaunchBar() { IIntroPart intro = PlatformUI.getWorkbench().getIntroManager() .getIntro(); if (intro == null) return false; CustomizableIntroPart cpart = (CustomizableIntroPart) intro; IntroModelRoot modelRoot = IntroPlugin.getDefault().getIntroModelRoot(); Rectangle bounds = cpart.getControl().getBounds(); Rectangle startBounds = Geometry.toDisplay(cpart.getControl() .getParent(), bounds); IntroLaunchBarElement launchBarElement = modelRoot.getPresentation().getLaunchBarElement(); if (launchBarElement == null) return true; IWorkbenchWindow window = intro.getIntroSite().getWorkbenchWindow(); IntroLaunchBar launchBar = IntroLaunchBar.create(window, modelRoot, launchBarElement); PlatformUI.getWorkbench().getIntroManager().setIntroStandby(intro, true); closeIntro(); Rectangle endBounds = Geometry.toDisplay(launchBar.getControl() .getParent(), launchBar.getControl().getBounds()); AnimationEngine.createTweakedAnimation(window.getShell(), 400, startBounds, endBounds); return true; } }
Rectangle subjectAreaDisplayRelative= Geometry.toDisplay(fSubjectControl, subjectArea);
Rectangle subjectAreaDisplayRelative= Geometry.toDisplay(fSubjectControl, subjectArea);