Package com.oorian.css
Enum Class TextAlign
- All Implemented Interfaces:
Serializable,Comparable<TextAlign>,Constable
CSS text-align property values for horizontal text alignment.
The text-align property specifies the horizontal alignment of inline content inside a block element or table cell.
Alignment Values:
- left: Aligns text to the left edge
- right: Aligns text to the right edge
- center: Centers text horizontally
- justify: Stretches lines to equal width
Usage:
element.setTextAlign(TextAlign.CENTER);
element.setTextAlign(TextAlign.JUSTIFY);
- 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 ConstantDescriptionCenters text horizontally.Aligns to the end of the line direction (writing-mode aware).Inherits from parent element.Sets to default value.Stretches lines so each has equal width.Aligns text to the left edge.Same as inherit if start is left, otherwise right (for RTL).Rolls back to the value defined by a previous cascade origin.Rolls back to the value defined in the previous cascade layer.Aligns text to the right edge.Aligns to the start of the line direction (writing-mode aware).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 TextAlignReturns the enum constant of this class with the specified name.static TextAlign[]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. -
LEFT
Aligns text to the left edge. -
CENTER
Centers text horizontally. -
RIGHT
Aligns text to the right edge. -
JUSTIFY
Stretches lines so each has equal width. -
START
Aligns to the start of the line direction (writing-mode aware). -
END
Aligns to the end of the line direction (writing-mode aware). -
MATCH_PARENT
Same as inherit if start is left, otherwise right (for RTL). -
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.
-