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; }
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; }
@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; }
@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; }
public void setSourceViewer(ISourceViewer sourceViewer) { if (getHovers() != null) { for (ITextHover hover : getHovers()) { if (hover instanceof ISourceViewerAware) ((ISourceViewerAware) hover).setSourceViewer(sourceViewer); } } }
@Override protected List<ITextHover> createHovers() { List<ITextHover> list = new ArrayList<ITextHover>(); list.add (annotationHover); if(htmlHover instanceof ITextHover) list.add ((ITextHover) htmlHover); return list; }
@Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { ITextHover hover = textHoverProvider.get(); if (hover instanceof ISourceViewerAware) { ((ISourceViewerAware) hover).setSourceViewer(sourceViewer); } return hover; }
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; }
@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); } }
/** * 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 ); }
@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); }
/** * Creates text hover * @return */ public ITextHover createTextHover() { try { return (ITextHover) configurationElement.createExecutableExtension(ATT_CLASS); } catch (CoreException e) { IdeLog.logError(CommonEditorPlugin.getDefault(), e); } return null; }
@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; }
/** * 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; }
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; }
@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; }
@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(); }
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 ); }
@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; }
@Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new BashTextHover(); }
@Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return editor == null ? null : new SQLEditorTextHover(sourceViewer, editor); }
@Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new KspTextHover(); }
@Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new EIffelTextHover(); }
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileTextHover(resourceProvider); }
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionTextHover(resourceProvider); }
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaTextHover(resourceProvider); }
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueTextHover(resourceProvider); }
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingTextHover(resourceProvider); }
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsTextHover(resourceProvider); }
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestTextHover(resourceProvider); }
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new DefaultTextHover(sourceViewer); }
/** * @Override */ public ITextHover getTextHover( ISourceViewer sourceViewer, String contentType){ return new MyTextHover(); }
/** * This allows text hover on Jimple Editor */ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new SootAttributesJimpleHover(getEditor()); }
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { if (textHover == null) { textHover = new TexHover(editor); } return textHover; }
@Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) { return null; }
@Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return null; }