Package org.fxmisc.richtext
Enum NavigationActions.SelectionPolicy
- java.lang.Object
-
- java.lang.Enum<NavigationActions.SelectionPolicy>
-
- org.fxmisc.richtext.NavigationActions.SelectionPolicy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<NavigationActions.SelectionPolicy>
- Enclosing interface:
- NavigationActions<PS,SEG,S>
public static enum NavigationActions.SelectionPolicy extends java.lang.Enum<NavigationActions.SelectionPolicy>
Indicates how to treat selection when caret is moved.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ADJUST
Moves the caret only without also moving the anchor, thereby making a selectionCLEAR
Move the caret and anchor to the same given position, thereby clearing any existing selectionEXTEND
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.
-
-
-
Enum Constant Detail
-
CLEAR
public static final NavigationActions.SelectionPolicy CLEAR
Move the caret and anchor to the same given position, thereby clearing any existing selection
-
ADJUST
public static final NavigationActions.SelectionPolicy ADJUST
Moves the caret only without also moving the anchor, thereby making a selection
-
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 namejava.lang.NullPointerException
- if the argument is null
-
-