@Override public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) { return getHoverInfo(textViewer, hoverRegion); }
protected ITypeRoot getEditorInputJavaElement() { IEditorPart editor= getEditor(); if (editor != null) return EditorUtility.getEditorInputJavaElement(editor, false); 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; } }
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { /* * The region should be a word region an not of length 0. * This check is needed because codeSelect(...) also finds * the Java element if the offset is behind the word. */ if (hoverRegion.getLength() == 0) return null; ICodeAssist resolve= getCodeAssist(); if (resolve != null) { try { IJavaElement[] result= resolve.codeSelect(hoverRegion.getOffset(), hoverRegion.getLength()); if (result == null) return null; int nResults= result.length; if (nResults == 0) return null; return getHoverInfo(result); } catch (JavaModelException x) { return null; } } return null; }
/** * Returns the Java elements at the given hover region. * * @param textViewer the text viewer * @param hoverRegion the hover region * @return the array with the Java elements or <code>null</code> * @since 3.4 */ protected IJavaElement[] getJavaElementsAt(ITextViewer textViewer, IRegion hoverRegion) { /* * The region should be a word region an not of length 0. * This check is needed because codeSelect(...) also finds * the Java element if the offset is behind the word. */ if (hoverRegion.getLength() == 0) return null; IDocument document= textViewer.getDocument(); if (document != null && isInheritDoc(document, hoverRegion)) return null; ICodeAssist resolve= getCodeAssist(); if (resolve != null) { try { return resolve.codeSelect(hoverRegion.getOffset(), hoverRegion.getLength()); } catch (JavaModelException x) { return null; } } return null; }
public void setEditor(IEditorPart editor) { super.setEditor(editor); if (fHover != null) fHover.setEditor(getEditor()); }
protected static String getStyleSheet() { if (fgStyleSheet == null) fgStyleSheet= loadStyleSheet(); String css= fgStyleSheet; if (css != null) { FontData fontData= JFaceResources.getFontRegistry().getFontData(PreferenceConstants.APPEARANCE_JAVADOC_FONT)[0]; css= HTMLPrinter.convertTopLevelFont(css, fontData); } return css; }
/** * Returns the Java elements at the given hover region. * * @param textViewer the text viewer * @param hoverRegion the hover region * @return the array with the Java elements or <code>null</code> * @since 3.4 */ protected IJavaElement[] getJavaElementsAt(ITextViewer textViewer, IRegion hoverRegion) { /* * The region should be a word region an not of length 0. * This check is needed because codeSelect(...) also finds * the Java element if the offset is behind the word. */ if (hoverRegion.getLength() == 0) return null; IDocument document= textViewer.getDocument(); if (document != null && isInheritDoc(document, hoverRegion)) return null; ICodeAssist resolve= getCodeAssist(); if (resolve != null) { try { return resolve.codeSelect(hoverRegion.getOffset(), hoverRegion.getLength()); } catch (JavaModelException x) { return null; } } return null; }
@Override public void setEditor(IEditorPart editor) { super.setEditor(editor); if (fHover != null) fHover.setEditor(getEditor()); }
@Override public void setEditor(IEditorPart editor) { super.setEditor(editor); if (fHover != null) fHover.setEditor(getEditor()); }
@Override public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) { return getHoverInfo(textViewer, hoverRegion); }
protected ITypeRoot getEditorInputJavaElement() { IEditorPart editor= getEditor(); if (editor != null) return EditorUtility.getEditorInputJavaElement(editor, false); 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; } }