Enum Class WordBreak

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

public enum WordBreak extends Enum<WordBreak>
CSS word-break property values for line breaking rules.

The word-break property specifies how words should break when reaching the end of a line. It determines whether breaks occur at specific points or anywhere within a word.

Break Values:

  • normal: Default line break rules
  • break-all: Words can break at any character
  • keep-all: CJK text doesn't break between characters

Usage:


 container.setWordBreak(WordBreak.BREAK_ALL);
 element.setWordBreak(WordBreak.NORMAL);
 
Since:
2012
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Enum Constant Details

    • INITIAL

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

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

      public static final WordBreak NORMAL
      Default line break rules for language.
    • BREAK_ALL

      public static final WordBreak BREAK_ALL
      Words can break at any character to prevent overflow.
    • KEEP_ALL

      public static final WordBreak KEEP_ALL
      CJK text won't break between characters; non-CJK is normal.
  • Method Details

    • values

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