Java 类org.eclipse.jface.text.IWidgetTokenOwnerExtension 实例源码

项目:Pydev    文件:InformationPresenterControlManager.java   
@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);
    }
}
项目:typescript.java    文件:RenameInformationPopup.java   
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);
    }
}
项目:bts    文件:RenameRefactoringPopup.java   
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);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:RenameInformationPopup.java   
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);
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:RenameInformationPopup.java   
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);
    }
}