Java 类org.eclipse.jface.text.contentassist.IContextInformationPresenter 实例源码

项目:APICloud-Studio    文件:ContextInformationPopup.java   
/**
 * Creates a context frame for the given offset.
 * 
 * @param information
 *            the context information
 * @param offset
 *            the offset
 * @return the created context frame
 * @since 3.0
 */
private ContextFrame createContextFrame(IContextInformation information, int offset)
{
    IContextInformationValidator validator = fContentAssistSubjectControlAdapter.getContextInformationValidator(
            fContentAssistant, offset);

    if (validator != null)
    {
        int beginOffset = (information instanceof IContextInformationExtension) ? ((IContextInformationExtension) information)
                .getContextInformationPosition() : offset;
        if (beginOffset == -1)
        {
            beginOffset = offset;
        }
        int visibleOffset = fContentAssistSubjectControlAdapter.getWidgetSelectionRange().x
                - (offset - beginOffset);
        IContextInformationPresenter presenter = fContentAssistSubjectControlAdapter
                .getContextInformationPresenter(fContentAssistant, offset);
        return new ContextFrame(information, beginOffset, offset, visibleOffset, validator, presenter);
    }

    return null;
}
项目:APICloud-Studio    文件:ContextInformationPopup.java   
public ContextFrame(IContextInformation information, int beginOffset, int offset, int visibleOffset,
        IContextInformationValidator validator, IContextInformationPresenter presenter)
{
    fInformation = information;
    fBeginOffset = beginOffset;
    fOffset = offset;
    fVisibleOffset = visibleOffset;
    fValidator = validator;
    fPresenter = presenter;
}
项目:Pydev    文件:SimpleAssistProcessor.java   
private ContextInformationDelegator(IContextInformationValidator defaultContextInformationValidator) {
    Assert.isTrue(defaultContextInformationValidator instanceof IContextInformationPresenter);
    this.defaultContextInformationValidator = defaultContextInformationValidator;
}
项目:Pydev    文件:SimpleAssistProcessor.java   
@Override
public boolean updatePresentation(int offset, TextPresentation presentation) {
    return ((IContextInformationPresenter) defaultContextInformationValidator).updatePresentation(offset,
            presentation);
}
项目:APICloud-Studio    文件:ContentAssistSubjectControlAdapter.java   
/**
 * Returns the context information presenter that should be used to display context information. The position is
 * used to determine the appropriate code assist processor to invoke.
 * 
 * @param contentAssistant
 *            the code assistant
 * @param offset
 *            a document offset
 * @return a presenter
 */
public IContextInformationPresenter getContextInformationPresenter(ContentAssistant contentAssistant, int offset)
{
    if (fContentAssistSubjectControl != null)
    {
        return contentAssistant.getContextInformationPresenter(fContentAssistSubjectControl, offset);
    }
    return contentAssistant.getContextInformationPresenter(fViewer, offset);
}
项目:APICloud-Studio    文件:ContentAssistant.java   
/**
 * Returns the context information presenter that should be used to display context information. The position is
 * used to determine the appropriate code assist processor to invoke.
 * 
 * @param viewer
 *            the text viewer
 * @param offset
 *            a document offset
 * @return a presenter
 * @since 2.0
 */
IContextInformationPresenter getContextInformationPresenter(ITextViewer viewer, int offset)
{
    IContextInformationValidator validator = getContextInformationValidator(viewer, offset);
    if (validator instanceof IContextInformationPresenter)
    {
        return (IContextInformationPresenter) validator;
    }
    return null;
}
项目:APICloud-Studio    文件:ContentAssistant.java   
/**
 * Returns the context information presenter that should be used to display context information. The position is
 * used to determine the appropriate code assist processor to invoke.
 * 
 * @param contentAssistSubjectControl
 *            the code assist subject control
 * @param offset
 *            a document offset
 * @return a presenter
 * @since 3.0
 */
IContextInformationPresenter getContextInformationPresenter(
        IContentAssistSubjectControl contentAssistSubjectControl, int offset)
{
    IContextInformationValidator validator = getContextInformationValidator(contentAssistSubjectControl, offset);
    if (validator instanceof IContextInformationPresenter)
    {
        return (IContextInformationPresenter) validator;
    }
    return null;
}