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

下面列出了怎么用org.eclipse.jface.text.contentassist.IContextInformationPresenter的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: 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;
}
 
源代码2 项目: 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;
}
 
源代码3 项目: Pydev   文件: SimpleAssistProcessor.java
private ContextInformationDelegator(IContextInformationValidator defaultContextInformationValidator) {
    Assert.isTrue(defaultContextInformationValidator instanceof IContextInformationPresenter);
    this.defaultContextInformationValidator = defaultContextInformationValidator;
}
 
源代码4 项目: Pydev   文件: SimpleAssistProcessor.java
@Override
public boolean updatePresentation(int offset, TextPresentation presentation) {
    return ((IContextInformationPresenter) defaultContextInformationValidator).updatePresentation(offset,
            presentation);
}
 
/**
 * 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);
}
 
源代码6 项目: 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;
}
 
源代码7 项目: 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;
}
 
 类所在包
 同包方法