当前位置: 首页>>代码示例>>Java>>正文


Java ITextHover类代码示例

本文整理汇总了Java中org.eclipse.jface.text.ITextHover的典型用法代码示例。如果您正苦于以下问题:Java ITextHover类的具体用法?Java ITextHover怎么用?Java ITextHover使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ITextHover类属于org.eclipse.jface.text包,在下文中一共展示了ITextHover类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getHoverRegion

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
	if (getHovers() != null) {
		for (ITextHover hover : getHovers()) {
			IRegion region = hover.getHoverRegion(textViewer, offset);
			if (region != null) {
				// We always take the first that answers with a region
				// In org.eclipse.xtext.ui.editor.hover.DefaultCompositeHover.createHovers() the AnnotationWithQuickFixesHover 
				// is always the first and answers with a region only when there is a problemmarker
				// In all other cases an instance of org.eclipse.xtext.ui.editor.hover.DispatchingEObjectTextHover is the next in the order.
				currentHover = hover;
				return region;
			}
		}
	}
	currentHover = null;
	return null;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:AbstractCompositeHover.java

示例2: getHoverInfo

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {

		checkTextHovers();
		fBestHover= null;

		if (fInstantiatedTextHovers == null)
			return null;

		for (Iterator<IJavaEditorTextHover> iterator= fInstantiatedTextHovers.iterator(); iterator.hasNext(); ) {
			ITextHover hover= iterator.next();
			if (hover == null)
				continue;

			String s= hover.getHoverInfo(textViewer, hoverRegion);
			if (s != null && s.trim().length() > 0) {
				fBestHover= hover;
				return s;
			}
		}

		return null;
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:BestMatchHover.java

示例3: getTextHover

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {

	GradleTextHover gradleTextHover = gradleTextHoverMap.get(contentType);
	if (gradleTextHover == null) {
		gradleTextHover = new GradleTextHover(this, sourceViewer, contentType);
		gradleTextHoverMap.put(contentType, gradleTextHover);
	}
	return gradleTextHover;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:11,代码来源:GradleSourceViewerConfiguration.java

示例4: getTextHover

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
	if (textHover == null) {
		if (debugModel) {
			textHover = new FluentMkTextHover(editor, sourceViewer, contentType);
		} else {
			textHover = super.getTextHover(sourceViewer, contentType);
		}
	}
	return textHover;
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:12,代码来源:FluentMkSourceViewerConfiguration.java

示例5: setSourceViewer

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
public void setSourceViewer(ISourceViewer sourceViewer) {
	if (getHovers() != null) {
		for (ITextHover hover : getHovers()) {
			if (hover instanceof ISourceViewerAware)
				((ISourceViewerAware) hover).setSourceViewer(sourceViewer);
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:9,代码来源:AbstractCompositeHover.java

示例6: createHovers

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
@Override
protected List<ITextHover> createHovers() {
	List<ITextHover> list = new ArrayList<ITextHover>();
	list.add (annotationHover);
	if(htmlHover instanceof ITextHover)
		list.add ((ITextHover) htmlHover);
	return list;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:9,代码来源:DefaultCompositeHover.java

示例7: getTextHover

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
	ITextHover hover = textHoverProvider.get();
	if (hover instanceof ISourceViewerAware) {
		((ISourceViewerAware) hover).setSourceViewer(sourceViewer);
	}
	return hover;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:9,代码来源:XtextSourceViewerConfiguration.java

示例8: getTextHover

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
public ITextHover getTextHover(ISourceViewer aSourceViewer, String aContentType)
{
    ITextHover hover;
    if (aContentType.equals(IDocument.DEFAULT_CONTENT_TYPE) || aContentType.equals(IEditorConfiguration.TAG_PARTITION) || aContentType.equals(IEditorConfiguration.PARSED_STRING))
    {
        hover = new VelocityTextHover(fEditor);
    } else
    {
        hover = null;
    }
    return hover;
}
 
开发者ID:ninneko,项目名称:velocity-edit,代码行数:13,代码来源:VelocityConfiguration.java

示例9: getTextHover

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer,
		String contentType) {
	if (EditorConstants.PARTITION_TYPE_TEMPLATE_PARAMETERS.equals(contentType)) {
		return new ParametersTextHover(sourceViewer);
	}
	else {
		return new CodeTextHover(sourceViewer);
	}
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:11,代码来源:BfSourceViewerConfiguration.java

示例10: getTextHover

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
/**
 * Set-up the hover manager (for when the user hovers their mouse over 
 * the code)
 */
/* Override */
public ITextHover getTextHover( ISourceViewer sourceViewer,
   String contentType )
{
   ZDebug.print( 3, "getTextHover( ", sourceViewer, ", ", contentType, " )" );
   return new TrafficScriptTextHover( editor );
}
 
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:12,代码来源:TrafficScriptConf.java

示例11: getHoverRegion

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public IRegion getHoverRegion(ITextViewer textViewer, int offset)
{
	activeTextHover = null;
	List<TextHoverDescriptor> descriptors = getEnabledTextHoverDescriptors(textViewer, offset);
	for (TextHoverDescriptor descriptor : descriptors)
	{
		ITextHover textHover = descriptor.createTextHover();
		IRegion region = null;
		if (textHover != null)
		{
			region = textHover.getHoverRegion(textViewer, offset);
		}
		if (region != null)
		{
			if (descriptors.size() > 1)
			{
				if (textHover instanceof ITextHoverExtension2)
				{
					if (((ITextHoverExtension2) textHover).getHoverInfo2(textViewer, region) == null)
					{
						continue;
					}
				}
				else if (textHover.getHoverInfo(textViewer, region) == null)
				{
					continue;
				}
			}
			activeTextHover = textHover;
			return region;
		}
	}
	return super.getHoverRegion(textViewer, offset);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:37,代码来源:CommonSourceViewerConfiguration.java

示例12: createTextHover

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
/**
 * Creates text hover
 * @return
 */
public ITextHover createTextHover() {
	try {
		return (ITextHover) configurationElement.createExecutableExtension(ATT_CLASS);
	} catch (CoreException e) {
		IdeLog.logError(CommonEditorPlugin.getDefault(), e);
	}
	return null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:13,代码来源:TextHoverDescriptor.java

示例13: getTextHover

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
	JavaEditorTextHoverDescriptor[] hoverDescs= JavaPlugin.getDefault().getJavaEditorTextHoverDescriptors();
	int i= 0;
	while (i < hoverDescs.length) {
		if (hoverDescs[i].isEnabled() &&  hoverDescs[i].getStateMask() == stateMask)
			return new JavaEditorTextHoverProxy(hoverDescs[i], getEditor());
		i++;
	}

	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:JavaSourceViewerConfiguration.java

示例14: getHoverInfo2

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
/**
 * Returns the information which should be presented when a hover or persistent popup is shown
 * for the specified hover region.
 * 
 * @param textViewer the viewer on which the hover popup should be shown
 * @param hoverRegion the text range in the viewer which is used to determine the hover display
 *            information
 * @param forInformationProvider <code>true</code> iff the hover info is requested by the
 *            information presenter. In this case, the method only considers text hovers for
 *            which a proper IInformationControlCreator is available that can supply focusable
 *            and resizable information controls.
 * 
 * @return the hover popup display information, or <code>null</code> if none available
 * 
 * @see ITextHoverExtension2#getHoverInfo2(ITextViewer, IRegion)
 * @since 3.8
 */
public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion, boolean forInformationProvider) {

	checkTextHovers();
	fBestHover= null;

	if (fInstantiatedTextHovers == null)
		return null;

	for (Iterator<IJavaEditorTextHover> iterator= fInstantiatedTextHovers.iterator(); iterator.hasNext(); ) {
		ITextHover hover= iterator.next();
		if (hover == null)
			continue;

		if (hover instanceof ITextHoverExtension2) {
			Object info= ((ITextHoverExtension2) hover).getHoverInfo2(textViewer, hoverRegion);
			if (info != null && !(forInformationProvider && getInformationPresenterControlCreator(hover) == null)) {
				fBestHover= hover;
				return info;
			}
		} else {
			String s= hover.getHoverInfo(textViewer, hoverRegion);
			if (s != null && s.trim().length() > 0) {
				fBestHover= hover;
				return s;
			}
		}
	}

	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:48,代码来源:BestMatchHover.java

示例15: getInformationPresenterControlCreator

import org.eclipse.jface.text.ITextHover; //导入依赖的package包/类
private static IInformationControlCreator getInformationPresenterControlCreator(ITextHover hover) {
	if (hover instanceof IInformationProviderExtension2) // this is wrong, but left here for backwards compatibility
		return ((IInformationProviderExtension2)hover).getInformationPresenterControlCreator();

	if (hover instanceof AbstractJavaEditorTextHover) {
		return ((AbstractJavaEditorTextHover) hover).getInformationPresenterControlCreator();
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:BestMatchHover.java


注:本文中的org.eclipse.jface.text.ITextHover类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。