Package com.oorian.css
Enum Class WhiteSpace
- All Implemented Interfaces:
Serializable,Comparable<WhiteSpace>,Constable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSimilar to pre-wrap but preserves breaking behavior for segments.Inherits from parent element.Sets to default value.Collapses whitespace, prevents text wrapping.Collapses whitespace, wraps text (default).Preserves all whitespace and line breaks.Preserves line breaks, collapses other whitespace.Preserves whitespace, wraps when necessary.Rolls back to the value defined by a previous cascade origin.Rolls back to the value defined in the previous cascade layer.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 WhiteSpaceReturns the enum constant of this class with the specified name.static WhiteSpace[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INITIAL
Sets to default value. -
INHERIT
Inherits from parent element. -
NORMAL
Collapses whitespace, wraps text (default). -
NO_WRAP
Collapses whitespace, prevents text wrapping. -
PRE
Preserves all whitespace and line breaks. -
PRE_LINE
Preserves line breaks, collapses other whitespace. -
PRE_WRAP
Preserves whitespace, wraps when necessary. -
BREAK_SPACES
Similar to pre-wrap but preserves breaking behavior for segments. -
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<WhiteSpace>- Returns:
- the CSS value
-