Enum Class JustifyContent

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

public enum JustifyContent extends Enum<JustifyContent>
CSS justify-content property values for flexbox main axis alignment.

The justify-content property aligns flex items along the main axis of the flex container. It distributes extra space when items don't use all available space on the main axis.

Alignment Values:

  • flex-start: Items packed to start of container
  • flex-end: Items packed to end of container
  • center: Items centered along main axis
  • space-between: Even spacing, first/last at edges
  • space-around: Even spacing with half-size edge gaps

Usage:


 container.setJustifyContent(JustifyContent.CENTER);
 container.setJustifyContent(JustifyContent.SPACE_BETWEEN);
 
Since:
2012
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Enum Constant Details

    • CENTER

      public static final JustifyContent CENTER
      Items centered along the main axis.
    • FLEX_START

      public static final JustifyContent FLEX_START
      Items packed toward the start of the main axis.
    • FLEX_END

      public static final JustifyContent FLEX_END
      Items packed toward the end of the main axis.
    • SPACE_BETWEEN

      public static final JustifyContent SPACE_BETWEEN
      Items evenly distributed with first/last at edges.
    • SPACE_AROUND

      public static final JustifyContent SPACE_AROUND
      Items evenly distributed with equal space around each.
    • SPACE_EVENLY

      public static final JustifyContent SPACE_EVENLY
      Items evenly distributed with equal space between them.
    • START

      public static final JustifyContent START
      Items packed to the start (writing-mode aware).
    • END

      public static final JustifyContent END
      Items packed to the end (writing-mode aware).
    • LEFT

      public static final JustifyContent LEFT
      Items packed to the left.
    • STRETCH

      public static final JustifyContent STRETCH
      Items stretched to distribute space evenly.
    • NORMAL

      public static final JustifyContent NORMAL
      Normal alignment behavior (context-dependent).
    • INITIAL

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

      public static final JustifyContent INHERIT
      Inherits from parent element.
  • Method Details

    • values

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