Enum Class WhiteSpace

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

public enum WhiteSpace extends Enum<WhiteSpace>
CSS white-space property values for whitespace handling.

The white-space property controls how whitespace inside an element is handled. It affects collapsing of whitespace, text wrapping, and preservation of line breaks.

Whitespace Handling:

  • normal: Collapses whitespace, wraps text (default)
  • nowrap: Collapses whitespace, no wrapping
  • pre: Preserves whitespace and line breaks
  • pre-wrap: Preserves whitespace, wraps if needed
  • pre-line: Collapses whitespace, preserves line breaks

Usage:


 code.setWhiteSpace(WhiteSpace.PRE);
 element.setWhiteSpace(WhiteSpace.NO_WRAP);
 
Since:
2012
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Enum Constant Details

    • INITIAL

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

      public static final WhiteSpace INHERIT
      Inherits from parent element.
    • NORMAL

      public static final WhiteSpace NORMAL
      Collapses whitespace, wraps text (default).
    • NO_WRAP

      public static final WhiteSpace NO_WRAP
      Collapses whitespace, prevents text wrapping.
    • PRE

      public static final WhiteSpace PRE
      Preserves all whitespace and line breaks.
    • PRE_LINE

      public static final WhiteSpace PRE_LINE
      Preserves line breaks, collapses other whitespace.
    • PRE_WRAP

      public static final WhiteSpace PRE_WRAP
      Preserves whitespace, wraps when necessary.
    • BREAK_SPACES

      public static final WhiteSpace BREAK_SPACES
      Similar to pre-wrap but preserves breaking behavior for segments.
    • UNSET

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

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

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

    • values

      public static WhiteSpace[] 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 WhiteSpace 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<WhiteSpace>
      Returns:
      the CSS value