Enum Class TextAlign

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

public enum TextAlign extends Enum<TextAlign>
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 Constants
    Enum Constant
    Description
    Centers 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 Type
    Method
    Description
    Returns the CSS value string.
    Returns the CSS value string.
    static TextAlign
    Returns the enum constant of this class with the specified name.
    static TextAlign[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • INITIAL

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

      public static final TextAlign INHERIT
      Inherits from parent element.
    • LEFT

      public static final TextAlign LEFT
      Aligns text to the left edge.
    • CENTER

      public static final TextAlign CENTER
      Centers text horizontally.
    • JUSTIFY

      public static final TextAlign JUSTIFY
      Stretches lines so each has equal width.
    • START

      public static final TextAlign START
      Aligns to the start of the line direction (writing-mode aware).
    • END

      public static final TextAlign END
      Aligns to the end of the line direction (writing-mode aware).
    • MATCH_PARENT

      public static final TextAlign MATCH_PARENT
      Same as inherit if start is left, otherwise right (for RTL).
    • UNSET

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

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

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

    • values

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