Package com.oorian.css
Enum Class UserSelect
- All Implemented Interfaces:
Serializable,Comparable<UserSelect>,Constable
CSS user-select property values for controlling text selection.
The user-select property controls whether the user can select text within an element. This is commonly used to prevent accidental selection of UI elements or to enable selection of typically non-selectable elements.
Common Values:
- auto: Browser decides selectability (default)
- none: Text cannot be selected
- text: Text can be selected
- all: Entire element is selected at once
- contain: Selection is limited to element bounds
Usage:
button.setUserSelect(UserSelect.NONE);
code.setUserSelect(UserSelect.ALL);
- Since:
- 2024
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionClicking selects the entire element content at once.Browser decides whether text is selectable (default).Selection is contained within the element bounds.Inherits from parent element.Sets to default value.Text cannot be selected by the user.Rolls back to the value defined by a previous cascade origin.Rolls back to the value defined in the previous cascade layer.Text can be selected by the user.Resets the property to its inherited value or initial value. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()Returns the CSS value string.toString()Returns the CSS value string.static UserSelectReturns the enum constant of this class with the specified name.static UserSelect[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
Browser decides whether text is selectable (default). -
NONE
Text cannot be selected by the user. -
TEXT
Text can be selected by the user. -
ALL
Clicking selects the entire element content at once. -
CONTAIN
Selection is contained within the element bounds. -
INITIAL
Sets to default value. -
INHERIT
Inherits from parent element. -
UNSET
Resets the property to its inherited value or initial value. -
REVERT
Rolls back to the value defined by a previous cascade origin. -
REVERT_LAYER
Rolls back to the value defined in the previous cascade layer.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
Returns the CSS value string.- Returns:
- the CSS value
-
toString
Returns the CSS value string.- Overrides:
toStringin classEnum<UserSelect>- Returns:
- the CSS value
-