Class RMTextSel


  • public class RMTextSel
    extends java.lang.Object
    A class to represent a selection of text.
    • Constructor Summary

      Constructors 
      Constructor Description
      RMTextSel​(RMTextEditor aText, int aStart, int anEnd)
      Creates a new selection.
      RMTextSel​(RMTextEditor aText, int aStart, int anEnd, int anAnchor)
      Creates a new selection.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAnchor()
      Returns the anchor.
      int getCharLeft()
      Moves the selection index backward a character (or if a range is selected, moves to beginning of range).
      int getCharRight()
      Moves the selection index forward a character (or if a range is selected, moves to end of range).
      int getEnd()
      Returns the end.
      int getLineEnd()
      Moves the insertion point to next newline or text end.
      int getLineStart()
      Moves the insertion point to the beginning of line.
      int getSize()
      The length.
      int getStart()
      Returns the start.
      java.lang.String getString()
      Returns the selected text string.
      RMTextEditor getText()
      Returns the text.
      boolean isEmpty()
      Returns whether selection is empty.
      protected boolean isWordChar​(char c)
      Returns whether a character should be considered is part of a word when WordSelecting.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RMTextSel

        public RMTextSel​(RMTextEditor aText,
                         int aStart,
                         int anEnd)
        Creates a new selection.
      • RMTextSel

        public RMTextSel​(RMTextEditor aText,
                         int aStart,
                         int anEnd,
                         int anAnchor)
        Creates a new selection.
    • Method Detail

      • getStart

        public int getStart()
        Returns the start.
      • getEnd

        public int getEnd()
        Returns the end.
      • getAnchor

        public int getAnchor()
        Returns the anchor.
      • getSize

        public int getSize()
        The length.
      • isEmpty

        public boolean isEmpty()
        Returns whether selection is empty.
      • getString

        public java.lang.String getString()
        Returns the selected text string.
      • getCharRight

        public int getCharRight()
        Moves the selection index forward a character (or if a range is selected, moves to end of range).
      • getCharLeft

        public int getCharLeft()
        Moves the selection index backward a character (or if a range is selected, moves to beginning of range).
      • getLineStart

        public int getLineStart()
        Moves the insertion point to the beginning of line.
      • getLineEnd

        public int getLineEnd()
        Moves the insertion point to next newline or text end.
      • isWordChar

        protected boolean isWordChar​(char c)
        Returns whether a character should be considered is part of a word when WordSelecting.