Enum Class TextBoxStyle

java.lang.Object
java.lang.Enum<TextBoxStyle>
org.refcodes.textual.TextBoxStyle
All Implemented Interfaces:
Serializable, Comparable<TextBoxStyle>, Constable, org.refcodes.mixin.BoxGrid<Character>, TextBoxGrid

public enum TextBoxStyle extends Enum<TextBoxStyle> implements TextBoxGrid
The TextBoxStyle enumeration defines character sets for various box grid representations. For example Box Drawing (Unicode block) characters are used, which are not available on every system or terminal: ╔══════════════════════════════════════════════════════════════════════════╗ ║ U+250x ─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏ ║ ║ U+251x ┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟ ║ ║ U+252x ┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯ ║ ║ U+253x ┰ ┱ ┲ ┳ ┴ ┵ ┶ ┷ ┸ ┹ ┺ ┻ ┼ ┽ ┾ ┿ ║ ║ U+254x ╀ ╁ ╂ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊ ╋ ╌ ╍ ╎ ╏ ║ ║ U+255x ═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟ ║ ║ U+256x ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬ ╭ ╮ ╯ ║ ║ U+257x ╰ ╱ ╲ ╳ ╴ ╵ ╶ ╷ ╸ ╹ ╺ ╻ ╼ ╽ ╾ ╿ ║ ╚══════════════════════════════════════════════════════════════════════════╝ Therefore plain ASCII character sets such as ASCII are provided as well.
  • Enum Constant Details

    • SINGLE

      public static final TextBoxStyle SINGLE
      Representation of the following text box grid: ┌─┬─┐ │ │ │ ├─┼─┤ │ │ │ └─┴─┘
    • SINGLE_DASHED

      public static final TextBoxStyle SINGLE_DASHED
      Representation of the following text box grid: ┌─┬─┐ │ │ │ ├─┼─┤ │ │ │ └─┴─┘
    • SINGLE_DOUBLE

      public static final TextBoxStyle SINGLE_DOUBLE
      Representation of the following text box grid: ╒═╤═╕ │ │ │ ╞═╪═╡ │ │ │ ╘═╧═╛
    • DOUBLE_SINGLE

      public static final TextBoxStyle DOUBLE_SINGLE
      Representation of the following text box grid: ╓─╥─╖ ║ ║ ║ ╟─╫─╢ ║ ║ ║ ╙─╨─╜
    • DOUBLE

      public static final TextBoxStyle DOUBLE
      Representation of the following text box grid: ╔═╦═╗ ║ ║ ║ ╠═╬═╣ ║ ║ ║ ╚═╩═╝
    • BOLD

      public static final TextBoxStyle BOLD
      Representation of the following text box grid: ┏━┳━┓ ┃ ┃ ┃ ┣━╋━┫ ┃ ┃ ┃ ┗━┻━┛
    • HYBRID_BOLD_SINGLE

      public static final TextBoxStyle HYBRID_BOLD_SINGLE
      Representation of the following text box grid: ┏━┳━┓ ┃ ┃ ┃ ┠─╂─┨ ┃ ┃ ┃ ┗━┻━┛
    • HYBRID_SINGLE_BOLD

      public static final TextBoxStyle HYBRID_SINGLE_BOLD
      Representation of the following text box grid: ┌─┰─┐ │ ┃ │ ┝━╋━┥ │ ┃ │ └─┸─┘
    • BOLD_HEADER_SINGLE_BODY

      public static final TextBoxStyle BOLD_HEADER_SINGLE_BODY
      Representation of the following text box grid: ┏━┳━┓ ┃ ┃ ┃ ┡━╇━┩ │ │ │ └─┴─┘
    • SINGLE_HEADER_BOLD_BODY

      public static final TextBoxStyle SINGLE_HEADER_BOLD_BODY
      Representation of the following text box grid: ┌─┬─┐ │ │ │ ┢━╈━┪ ┃ ┃ ┃ ┗━┻━┛
    • HYBRID_BOLD_HEADER_SINGLE_BODY

      public static final TextBoxStyle HYBRID_BOLD_HEADER_SINGLE_BODY
      Representation of the following text box grid: ┏━┯━┓ ┃ │ ┃ ┡━┿━┩ │ │ │ └─┴─┘
    • HYBRID_SINGLE_HEADER_BOLD_BODY

      public static final TextBoxStyle HYBRID_SINGLE_HEADER_BOLD_BODY
      Representation of the following text box grid: ┌─┬─┐ │ │ │ ┢━┿━┪ ┃ │ ┃ ┗━┷━┛
    • HYBRID_DOUBLE_SINGLE

      public static final TextBoxStyle HYBRID_DOUBLE_SINGLE
      Representation of the following text box grid: ╔═╤═╗ ║ │ ║ ╠═╪═╣ ║ │ ║ ╚═╧═╝
    • HYBRID_SINGLE_DOUBLE

      public static final TextBoxStyle HYBRID_SINGLE_DOUBLE
      Representation of the following text box grid: ┌─╥─┐ │ ║ │ ├─╫─┤ │ ║ │ └─╨─┘
    • DOUBLE_BORDER_SINGLE_CONTENT

      public static final TextBoxStyle DOUBLE_BORDER_SINGLE_CONTENT
      Representation of the following text box grid: ╔═╤═╗ ║ │ ║ ╟─┼─╢ ║ │ ║ ╚═╧═╝
    • SINGLE_BORDER_DOUBLE_CONTENT

      public static final TextBoxStyle SINGLE_BORDER_DOUBLE_CONTENT
      Representation of the following text box grid: ┌─╥─┐ │ ║ │ ╞═╬═╡ │ ║ │ └─╨─┘
    • ASCII

      public static final TextBoxStyle ASCII
      Representation of the following text box grid: /-+-\ | | | +-+-+ | | | \-+-/
    • BLANK

      public static final TextBoxStyle BLANK
      Representation of the following text box grid: " " " " " " " " " "
    • SINGLE_BLANK

      public static final TextBoxStyle SINGLE_BLANK
      Representation of the following text box grid: " ─ ─ " " " " ─ ─ " " " " ─ ─ "
    • ASCII_BLANK

      public static final TextBoxStyle ASCII_BLANK
      Representation of the following text box grid: " - - " " " " - - " " " " - - "
  • Field Details

    • UNICODE_TEXT_BOX_STYLE

      public static final TextBoxStyle UNICODE_TEXT_BOX_STYLE
      Style supported Unicode capable terminals (when not being under test).
    • WINDOWS_TEXT_BOX_STYLE

      public static final TextBoxStyle WINDOWS_TEXT_BOX_STYLE
      Style displayed for sure when being on a Windows machine.
    • ASCII_TEXT_BOX_STYLE

      public static final TextBoxStyle ASCII_TEXT_BOX_STYLE
      Style displayed for sure when being under test (e.g. JUnit) or in a Cp1252 or a plain "xterm".
  • Method Details

    • values

      public static TextBoxStyle[] 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 TextBoxStyle 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
    • getLeftEdge

      public Character getLeftEdge()
      Specified by:
      getLeftEdge in interface org.refcodes.mixin.BoxGrid<Character>
    • getTopLeftEdge

      public Character getTopLeftEdge()
      Specified by:
      getTopLeftEdge in interface org.refcodes.mixin.BoxGrid<Character>
    • getDividerEdge

      public Character getDividerEdge()
      Specified by:
      getDividerEdge in interface org.refcodes.mixin.BoxGrid<Character>
    • getTopDividerEdge

      public Character getTopDividerEdge()
      Specified by:
      getTopDividerEdge in interface org.refcodes.mixin.BoxGrid<Character>
    • getTopRightEdge

      public Character getTopRightEdge()
      Specified by:
      getTopRightEdge in interface org.refcodes.mixin.BoxGrid<Character>
    • getRightEdge

      public Character getRightEdge()
      Specified by:
      getRightEdge in interface org.refcodes.mixin.BoxGrid<Character>
    • getLeftLine

      public Character getLeftLine()
      Specified by:
      getLeftLine in interface org.refcodes.mixin.BoxGrid<Character>
    • getDividerLine

      public Character getDividerLine()
      Specified by:
      getDividerLine in interface org.refcodes.mixin.BoxGrid<Character>
    • getRightLine

      public Character getRightLine()
      Specified by:
      getRightLine in interface org.refcodes.mixin.BoxGrid<Character>
    • getTopLine

      public Character getTopLine()
      Specified by:
      getTopLine in interface org.refcodes.mixin.BoxGrid<Character>
    • getBottomRightEdge

      public Character getBottomRightEdge()
      Specified by:
      getBottomRightEdge in interface org.refcodes.mixin.BoxGrid<Character>
    • getBottomDividerEdge

      public Character getBottomDividerEdge()
      Specified by:
      getBottomDividerEdge in interface org.refcodes.mixin.BoxGrid<Character>
    • getBottomLeftEdge

      public Character getBottomLeftEdge()
      Specified by:
      getBottomLeftEdge in interface org.refcodes.mixin.BoxGrid<Character>
    • getBottomLine

      public Character getBottomLine()
      Specified by:
      getBottomLine in interface org.refcodes.mixin.BoxGrid<Character>
    • getInnerLine

      public Character getInnerLine()
      Specified by:
      getInnerLine in interface org.refcodes.mixin.BoxGrid<Character>
    • toTextBoxGrid

      public static TextBoxGrid toTextBoxGrid(String aValue)
      Retrieves the best fitting TextBoxStyle for the given value by ignoring the characters' case as well as all "-" and "_" characters in the provided value as well as in the enumeration's name..
      Parameters:
      aValue - The value for which to determine the TextBoxStyle.
      Returns:
      The according TextBoxStyle or null if none was found.
    • toExecutionTextBoxGrid

      public static TextBoxGrid toExecutionTextBoxGrid()
      Depending on the runtime environment (Windows, Linux, JUnit) we prefer different text box styles as depending on the runtime environment not all characters used by the various text box styles may be available.
      Returns:
      The TextBoxStyle by default fitting best for the current environment.