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

项目:bts    文件:AbstractCompositeHover.java   
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;
}
项目:Eclipse-Postfix-Code-Completion    文件:BestMatchHover.java   
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;
    }
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:BestMatchHover.java   
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;
    }
项目:egradle    文件:GradleSourceViewerConfiguration.java   
@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;
}
项目:fluentmark    文件:FluentMkSourceViewerConfiguration.java   
@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;
}
项目:bts    文件:AbstractCompositeHover.java   
public void setSourceViewer(ISourceViewer sourceViewer) {
    if (getHovers() != null) {
        for (ITextHover hover : getHovers()) {
            if (hover instanceof ISourceViewerAware)
                ((ISourceViewerAware) hover).setSourceViewer(sourceViewer);
        }
    }
}
项目:bts    文件:DefaultCompositeHover.java   
@Override
protected List<ITextHover> createHovers() {
    List<ITextHover> list = new ArrayList<ITextHover>();
    list.add (annotationHover);
    if(htmlHover instanceof ITextHover)
        list.add ((ITextHover) htmlHover);
    return list;
}
项目:bts    文件:XtextSourceViewerConfiguration.java   
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    ITextHover hover = textHoverProvider.get();
    if (hover instanceof ISourceViewerAware) {
        ((ISourceViewerAware) hover).setSourceViewer(sourceViewer);
    }
    return hover;
}
项目:velocity-edit    文件:VelocityConfiguration.java   
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;
}
项目:brainfuck    文件:BfSourceViewerConfiguration.java   
@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);
    }
}
项目:vTM-eclipse    文件:TrafficScriptConf.java   
/**
 * 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 );
}
项目:APICloud-Studio    文件:CommonSourceViewerConfiguration.java   
@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);
}
项目:APICloud-Studio    文件:TextHoverDescriptor.java   
/**
 * Creates text hover
 * @return
 */
public ITextHover createTextHover() {
    try {
        return (ITextHover) configurationElement.createExecutableExtension(ATT_CLASS);
    } catch (CoreException e) {
        IdeLog.logError(CommonEditorPlugin.getDefault(), e);
    }
    return null;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaSourceViewerConfiguration.java   
@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;
}
项目:Eclipse-Postfix-Code-Completion    文件:BestMatchHover.java   
/**
 * 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;
}
项目:Eclipse-Postfix-Code-Completion    文件:BestMatchHover.java   
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;
}
项目:idecore    文件:ApexSourceViewerConfiguration.java   
@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], fTextEditor);
        i++;
    }

    return null;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaSourceViewerConfiguration.java   
@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;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:BestMatchHover.java   
/**
 * 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;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:BestMatchHover.java   
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;
}
项目:Eclipse-Markdown-Editor-Plugin    文件:MDConfiguration.java   
@SuppressWarnings("unused")
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer,
        String contentType) {
    if (true) return super.getTextHover(sourceViewer, contentType);
    // Add hover support for images
    return new MDTextHover();
}
项目:birt    文件:DebugScriptSourceViewerConfiguration.java   
public ITextHover getTextHover( ISourceViewer sourceViewer,
        String contentType, int stateMask )
{

    if ( !( JSPartitionScanner.JS_COMMENT.equals( contentType )
            //|| JSPartitionScanner.JS_KEYWORD.equals( contentType ) 
            || JSPartitionScanner.JS_STRING.equals( contentType ) ) )
    {
        return new ScriptDebugHover( );
    }
    return super.getTextHover( sourceViewer, contentType, stateMask );
}
项目:Pydev    文件:PyEditConfiguration.java   
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
    /**
     * Return the combining hover if the preferences are set accordingly and the state mask matches.
     */
    if (PyHoverPreferencesPage.getCombineHoverInfo()) {
        PyEditorTextHoverDescriptor combiningHover = PydevPlugin.getCombiningHoverDescriptor();
        if (combiningHover.getStateMask() == stateMask) {
            return new PyEditorTextHoverProxy(combiningHover, contentType);
        }
    }

    /**
     * We return the highest priority registered hover whose state mask matches. If two or more hovers
     * have the highest priority, it is indeterminate which will be selected. The proper way to combine
     * hover info is to select that option on the PyDev->Editor->Hover preference page. This will cause
     * the combining hover to be returned by the code above.
     */
    PyEditorTextHoverDescriptor[] hoverDescs = PydevPlugin.getDefault().getPyEditorTextHoverDescriptors();
    int i = 0;
    while (i < hoverDescs.length) {
        if (hoverDescs[i].isEnabled() && hoverDescs[i].getStateMask() == stateMask) {
            return new PyEditorTextHoverProxy(hoverDescs[i], contentType);
        }
        i++;
    }

    return null;
}
项目:eclipse-bash-editor    文件:BashSourceViewerConfiguration.java   
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new BashTextHover();
}
项目:pgcodekeeper    文件:SQLEditorSourceViewerConfiguration.java   
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return editor == null ? null : new SQLEditorTextHover(sourceViewer, editor);
}
项目:vertigo-chroma-kspplugin    文件:KspSourceViewerConfiguration.java   
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new KspTextHover();
}
项目:LibertyEiffel-Eclipse-Plugin    文件:EiffelSourceViewerConfiguration.java   
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {

    return new EIffelTextHover();
}
项目:DarwinSPL    文件:DwprofileSourceViewerConfiguration.java   
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileTextHover(resourceProvider);
}
项目:DarwinSPL    文件:HyexpressionSourceViewerConfiguration.java   
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionTextHover(resourceProvider);
}
项目:DarwinSPL    文件:HyvalidityformulaSourceViewerConfiguration.java   
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaTextHover(resourceProvider);
}
项目:DarwinSPL    文件:HydatavalueSourceViewerConfiguration.java   
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueTextHover(resourceProvider);
}
项目:DarwinSPL    文件:HymappingSourceViewerConfiguration.java   
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingTextHover(resourceProvider);
}
项目:DarwinSPL    文件:HyconstraintsSourceViewerConfiguration.java   
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsTextHover(resourceProvider);
}
项目:DarwinSPL    文件:HymanifestSourceViewerConfiguration.java   
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestTextHover(resourceProvider);
}
项目:subclipse    文件:CommitCommentArea.java   
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new DefaultTextHover(sourceViewer);
}
项目:http4e    文件:HConfiguration.java   
/**
 * @Override
 */
public ITextHover getTextHover( ISourceViewer sourceViewer, String contentType){
   return new MyTextHover();
}
项目:JAADAS    文件:JimpleConfiguration.java   
/**
 * This allows text hover on Jimple Editor 
 */
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return new SootAttributesJimpleHover(getEditor());
}
项目:texlipse    文件:TexSourceViewerConfiguration.java   
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    if (textHover == null) {
        textHover = new TexHover(editor);
    }
    return textHover;
}
项目:fluentmark    文件:FluentMkSimpleSourceViewerConfiguration.java   
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
    return null;
}
项目:fluentmark    文件:FluentMkSimpleSourceViewerConfiguration.java   
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return null;
}