Search in sources :

Example 16 with ErlangEditor

use of org.erlide.ui.editors.erl.ErlangEditor in project erlide_eclipse by erlang.

the class EdocView method getInfoForSelection.

@Override
protected Object getInfoForSelection(final IWorkbenchPart part, final ISelection selection) {
    if (selection instanceof ITextSelection && part instanceof ErlangEditor) {
        final ITextSelection sel = (ITextSelection) selection;
        final ErlangEditor editor = (ErlangEditor) part;
        return ErlTextHover.getHoverInfoForOffset(sel.getOffset(), editor);
    }
    return null;
}
Also used : ITextSelection(org.eclipse.jface.text.ITextSelection) ErlangEditor(org.erlide.ui.editors.erl.ErlangEditor)

Aggregations

ErlangEditor (org.erlide.ui.editors.erl.ErlangEditor)16 IEditorPart (org.eclipse.ui.IEditorPart)9 IErlModule (org.erlide.engine.model.root.IErlModule)7 AbstractErlangEditor (org.erlide.ui.editors.erl.AbstractErlangEditor)6 ErlModelException (org.erlide.engine.model.ErlModelException)4 BadLocationException (org.eclipse.jface.text.BadLocationException)3 ITextSelection (org.eclipse.jface.text.ITextSelection)3 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)3 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)3 IFile (org.eclipse.core.resources.IFile)2 IDocument (org.eclipse.jface.text.IDocument)2 ISelection (org.eclipse.jface.viewers.ISelection)2 IEditorReference (org.eclipse.ui.IEditorReference)2 PartInitException (org.eclipse.ui.PartInitException)2 IErlElement (org.erlide.engine.model.IErlElement)2 IErlModel (org.erlide.engine.model.root.IErlModel)2 OtpErlangRangeException (com.ericsson.otp.erlang.OtpErlangRangeException)1 File (java.io.File)1 IOException (java.io.IOException)1 IResource (org.eclipse.core.resources.IResource)1