Enum Class UserSelect

java.lang.Object
java.lang.Enum<UserSelect>
com.oorian.css.UserSelect
All Implemented Interfaces:
Serializable, Comparable<UserSelect>, Constable

public enum UserSelect extends Enum<UserSelect>
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:
  • Enum Constant Details

    • AUTO

      public static final UserSelect AUTO
      Browser decides whether text is selectable (default).
    • NONE

      public static final UserSelect NONE
      Text cannot be selected by the user.
    • TEXT

      public static final UserSelect TEXT
      Text can be selected by the user.
    • ALL

      public static final UserSelect ALL
      Clicking selects the entire element content at once.
    • CONTAIN

      public static final UserSelect CONTAIN
      Selection is contained within the element bounds.
    • INITIAL

      public static final UserSelect INITIAL
      Sets to default value.
    • INHERIT

      public static final UserSelect INHERIT
      Inherits from parent element.
    • UNSET

      public static final UserSelect UNSET
      Resets the property to its inherited value or initial value.
    • REVERT

      public static final UserSelect REVERT
      Rolls back to the value defined by a previous cascade origin.
    • REVERT_LAYER

      public static final UserSelect REVERT_LAYER
      Rolls back to the value defined in the previous cascade layer.
  • Method Details

    • values

      public static UserSelect[] 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

      public static UserSelect valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Returns the CSS value string.
      Returns:
      the CSS value
    • toString

      public String toString()
      Returns the CSS value string.
      Overrides:
      toString in class Enum<UserSelect>
      Returns:
      the CSS value