Enum NavigationActions.SelectionPolicy

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ADJUST
      Moves the caret only without also moving the anchor, thereby making a selection
      CLEAR
      Move the caret and anchor to the same given position, thereby clearing any existing selection
      EXTEND
      Extends the selection by updating the "boundary" of the selection that is closest to the new position (i.e.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static NavigationActions.SelectionPolicy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static NavigationActions.SelectionPolicy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • EXTEND

        public static final NavigationActions.SelectionPolicy EXTEND
        Extends the selection by updating the "boundary" of the selection that is closest to the new position (i.e. either the selection's start or end position) to that new position and keeping the other position the same. In either case, the caret position is updated to that new position while the anchor is updated to the opposite boundary.

        Using the following example, where "||" is the anchor, "|" is the caret" and "_" is the new position, EXTEND updates the values to:

        
         "A text ||with| a _selection" -> "A text ||with a |selection"
         "A _text ||with| a selection" -> "A |text with|| a selection"
         
    • Method Detail

      • values

        public static NavigationActions.SelectionPolicy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (NavigationActions.SelectionPolicy c : NavigationActions.SelectionPolicy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static NavigationActions.SelectionPolicy valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null