- java.lang.Object
-
- java.lang.Enum<TextBoxStyle>
-
- org.refcodes.textual.TextBoxStyle
-
- All Implemented Interfaces:
Serializable,Comparable<TextBoxStyle>
public enum TextBoxStyle extends Enum<TextBoxStyle>
TheTextBoxStyleenumeration 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 asASCIIare provided as well.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ASCIIRepresentation of the following text box grid:/-+-\ | | | +-+-+ | | | \-+-/ASCII_BLANKRepresentation of the following text box grid:" - - " " " " - - " " " " - - "BLANKRepresentation of the following text box grid:" " " " " " " " " "BOLDRepresentation of the following text box grid:┏━┳━┓ ┃ ┃ ┃ ┣━╋━┫ ┃ ┃ ┃ ┗━┻━┛BOLD_HEADER_SINGLE_BODYRepresentation of the following text box grid:┏━┳━┓ ┃ ┃ ┃ ┡━╇━┩ │ │ │ └─┴─┘DOUBLERepresentation of the following text box grid:╔═╦═╗ ║ ║ ║ ╠═╬═╣ ║ ║ ║ ╚═╩═╝DOUBLE_BORDER_SINGLE_CONTENTRepresentation of the following text box grid:╔═╤═╗ ║ │ ║ ╟─┼─╢ ║ │ ║ ╚═╧═╝DOUBLE_SINGLERepresentation of the following text box grid:╓─╥─╖ ║ ║ ║ ╟─╫─╢ ║ ║ ║ ╙─╨─╜HYBRID_BOLD_HEADER_SINGLE_BODYRepresentation of the following text box grid:┏━┯━┓ ┃ │ ┃ ┡━┿━┩ │ │ │ └─┴─┘HYBRID_BOLD_SINGLERepresentation of the following text box grid:┏━┳━┓ ┃ ┃ ┃ ┠─╂─┨ ┃ ┃ ┃ ┗━┻━┛HYBRID_DOUBLE_SINGLERepresentation of the following text box grid:╔═╤═╗ ║ │ ║ ╠═╪═╣ ║ │ ║ ╚═╧═╝HYBRID_SINGLE_BOLDRepresentation of the following text box grid:┌─┰─┐ │ ┃ │ ┝━╋━┥ │ ┃ │ └─┸─┘HYBRID_SINGLE_DOUBLERepresentation of the following text box grid:┌─╥─┐ │ ║ │ ├─╫─┤ │ ║ │ └─╨─┘HYBRID_SINGLE_HEADER_BOLD_BODYRepresentation of the following text box grid:┌─┬─┐ │ │ │ ┢━┿━┪ ┃ │ ┃ ┗━┷━┛SINGLERepresentation of the following text box grid:┌─┬─┐ │ │ │ ├─┼─┤ │ │ │ └─┴─┘SINGLE_BLANKRepresentation of the following text box grid:" ─ ─ " " " " ─ ─ " " " " ─ ─ "SINGLE_BORDER_DOUBLE_CONTENTRepresentation of the following text box grid:┌─╥─┐ │ ║ │ ╞═╬═╡ │ ║ │ └─╨─┘SINGLE_DASHEDRepresentation of the following text box grid:┌─┬─┐ │ │ │ ├─┼─┤ │ │ │ └─┴─┘SINGLE_DOUBLERepresentation of the following text box grid:╒═╤═╕ │ │ │ ╞═╪═╡ │ │ │ ╘═╧═╛SINGLE_HEADER_BOLD_BODYRepresentation of the following text box grid:┌─┬─┐ │ │ │ ┢━╈━┪ ┃ ┃ ┃ ┗━┻━┛
-
Field Summary
Fields Modifier and Type Field Description static TextBoxStyleOTHER_TEXT_BOX_STYLEStyle displayed for sure when being under test (e.g.static TextBoxStyleUNICODE_TEXT_BOX_STYLEStyle supported Unicode capable terminals (when not being under test).static TextBoxStyleWINDOWS_TEXT_BOX_STYLEStyle displayed for sure when being on a Windows machine.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TextBoxGridgetTextBoxGrid()Returns theTextBoxStyle's characters.static TextBoxStyletoRuntimeTextBoxStyle()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.static TextBoxStyletoTableStyle(String aValue)Retrieves the best fittingTextBoxStylefor 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..static TextBoxStylevalueOf(String name)Returns the enum constant of this type with the specified name.static TextBoxStyle[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
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.
-
OTHER_TEXT_BOX_STYLE
public static final TextBoxStyle OTHER_TEXT_BOX_STYLE
Style displayed for sure when being under test (e.g. JUnit) or in a Cp1252 or a plain "xterm".
-
-
Method Detail
-
values
public static TextBoxStyle[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TextBoxStyle c : TextBoxStyle.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TextBoxStyle valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
getTextBoxGrid
public TextBoxGrid getTextBoxGrid()
Returns theTextBoxStyle's characters.- Returns:
- The according
TextBoxGridinstance representing theTextBoxStyle.
-
toTableStyle
public static TextBoxStyle toTableStyle(String aValue)
Retrieves the best fittingTextBoxStylefor 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 theTextBoxStyle.- Returns:
- The according
TextBoxStyleor null if none was found.
-
toRuntimeTextBoxStyle
public static TextBoxStyle toRuntimeTextBoxStyle()
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
TextBoxStyleby default fitting best for the current environment.
-
-