@Override protected void showInformationControl(Rectangle subjectArea) { if (fControl instanceof IWidgetTokenOwnerExtension && fControl instanceof IWidgetTokenOwner) { IWidgetTokenOwnerExtension extension = (IWidgetTokenOwnerExtension) fControl; if (extension.requestWidgetToken(this, WIDGET_PRIORITY)) { super.showInformationControl(subjectArea); } } else if (fControl instanceof IWidgetTokenOwner) { IWidgetTokenOwner owner = (IWidgetTokenOwner) fControl; if (owner.requestWidgetToken(this)) { super.showInformationControl(subjectArea); } } else { super.showInformationControl(subjectArea); } }
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); } }