Class MarkSelection

    • Constructor Detail

      • MarkSelection

        public MarkSelection​(IDocument document,
                             int offset,
                             int length)
        Creates a MarkSelection.
        Parameters:
        document - the marked document
        offset - the offset of the mark
        length - the length of the mark, may be negative if caret before offset
    • Method Detail

      • getOffset

        public int getOffset()
        Description copied from interface: IMarkSelection
        Returns the mark position. The offset may be -1 if there's no marked region.
        Specified by:
        getOffset in interface IMarkSelection
        Returns:
        the mark position or -1 if there is no marked region
      • getLength

        public int getLength()
        Description copied from interface: IMarkSelection
        Returns the length of the mark selection. The length may be negative, if the caret is before the mark position. The length has no meaning if getOffset() returns -1.
        Specified by:
        getLength in interface IMarkSelection
        Returns:
        the length of the mark selection. Result is undefined for getOffset == -1
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: ISelection
        Returns whether this selection is empty.
        Specified by:
        isEmpty in interface ISelection
        Returns:
        true if this selection is empty, and false otherwise