Class TextViewerOutlinePopupTarget

  • All Implemented Interfaces:
    org.eclipse.handly.ui.quickoutline.IOutlinePopupHost

    public class TextViewerOutlinePopupTarget
    extends Object
    implements org.eclipse.handly.ui.quickoutline.IOutlinePopupHost
    Outline popup target, based on given text viewer and underlying file (for ISourceFile work).
    See Also:
    IOutlinePopupHost, OutlinePopup
    • Constructor Detail

      • TextViewerOutlinePopupTarget

        public TextViewerOutlinePopupTarget​(org.eclipse.jface.text.ITextViewer viewer,
                                            org.eclipse.core.resources.IFile file)
        Parameters:
        viewer - target viewer
        file - uderlying file
    • Method Detail

      • getControl

        public org.eclipse.swt.widgets.Control getControl()
        Specified by:
        getControl in interface org.eclipse.handly.ui.quickoutline.IOutlinePopupHost
      • getSelectionProvider

        public ISelectionProvider getSelectionProvider()
        Specified by:
        getSelectionProvider in interface org.eclipse.handly.ui.quickoutline.IOutlinePopupHost
      • getEditorInput

        public org.eclipse.ui.IEditorInput getEditorInput()
        Specified by:
        getEditorInput in interface org.eclipse.handly.ui.quickoutline.IOutlinePopupHost
      • selectAndReveal

        public void selectAndReveal​(int offset,
                                    int length)
        Ensures that the given range is visible. Sets the selection to the specified range.
        Parameters:
        offset - the offset of the selection range
        length - the length of the selection range. A negative length places the caret at the visual start of the selection.
      • isVisible

        protected boolean isVisible​(org.eclipse.jface.text.ITextViewer viewer,
                                    int offset,
                                    int length)
        Tells whether the given region is visible in the given source viewer.
        Parameters:
        viewer - text viewer
        offset - the offset of the selection
        length - the length of the selection
        Returns:
        true if visible