Package com.sun.javatest.tool
Enum UIFactory.Colors
- java.lang.Object
-
- java.lang.Enum<UIFactory.Colors>
-
- com.sun.javatest.tool.UIFactory.Colors
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<UIFactory.Colors>
- Enclosing class:
- UIFactory
public static enum UIFactory.Colors extends java.lang.Enum<UIFactory.Colors>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BLACKBUTTON_DISABLED_FOREGROUNDCONTROL_INFOCONTROL_SHADOWINPUT_DEFAULTDefault background color for input fieldsINPUT_INVALIDColor used for highlighting incorrect input fieldsINPUT_VALIDColor used for highlighting correct input fieldsMENU_BACKGROUNDPRIMARY_CONTROLPRIMARY_CONTROL_DARK_SHADOWPRIMARY_CONTROL_HIGHLIGHTPRIMARY_CONTROL_INFOPRIMARY_CONTROL_SHADOWSEPARATOR_FOREGROUNDTEXT_COLORTEXT_HIGHLIGHT_COLORTEXT_SELECTED_COLORTRANSPARENTWINDOW_BACKGROUND
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.awt.ColordecodeRGBA(java.lang.String color)static java.lang.StringencodeARGB(java.awt.Color color)static java.awt.ColorgetColorByPreferencesName(java.lang.String prefsName)Get Color by colors preferences name.static java.lang.String[]getColorsNames()Get array with all colors names used in preferencesjava.lang.StringgetDefaultValue()Getter for default String-encoded color value.java.lang.StringgetPreferencesName()Get color name used in preferences file.java.awt.ColorgetValue()Getter for current color value.booleanisConfigurable()java.awt.ColorreadColorFromPreferences()Read color value from preferences ignoring current color value that is returned by getValue();java.awt.ColorsetValue(java.awt.Color c)Setter for current color value.static UIFactory.ColorsvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static UIFactory.ColorsvalueOfByPreferencesName(java.lang.String prefsName)Find Colors by color preferences name.static UIFactory.Colors[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INPUT_INVALID
public static final UIFactory.Colors INPUT_INVALID
Color used for highlighting incorrect input fields
-
INPUT_VALID
public static final UIFactory.Colors INPUT_VALID
Color used for highlighting correct input fields
-
INPUT_DEFAULT
public static final UIFactory.Colors INPUT_DEFAULT
Default background color for input fields
-
MENU_BACKGROUND
public static final UIFactory.Colors MENU_BACKGROUND
-
SEPARATOR_FOREGROUND
public static final UIFactory.Colors SEPARATOR_FOREGROUND
-
CONTROL_INFO
public static final UIFactory.Colors CONTROL_INFO
-
CONTROL_SHADOW
public static final UIFactory.Colors CONTROL_SHADOW
-
TEXT_HIGHLIGHT_COLOR
public static final UIFactory.Colors TEXT_HIGHLIGHT_COLOR
-
TEXT_COLOR
public static final UIFactory.Colors TEXT_COLOR
-
TEXT_SELECTED_COLOR
public static final UIFactory.Colors TEXT_SELECTED_COLOR
-
WINDOW_BACKGROUND
public static final UIFactory.Colors WINDOW_BACKGROUND
-
PRIMARY_CONTROL_HIGHLIGHT
public static final UIFactory.Colors PRIMARY_CONTROL_HIGHLIGHT
-
PRIMARY_CONTROL_INFO
public static final UIFactory.Colors PRIMARY_CONTROL_INFO
-
BUTTON_DISABLED_FOREGROUND
public static final UIFactory.Colors BUTTON_DISABLED_FOREGROUND
-
PRIMARY_CONTROL_SHADOW
public static final UIFactory.Colors PRIMARY_CONTROL_SHADOW
-
PRIMARY_CONTROL
public static final UIFactory.Colors PRIMARY_CONTROL
-
PRIMARY_CONTROL_DARK_SHADOW
public static final UIFactory.Colors PRIMARY_CONTROL_DARK_SHADOW
-
BLACK
public static final UIFactory.Colors BLACK
-
TRANSPARENT
public static final UIFactory.Colors TRANSPARENT
-
-
Method Detail
-
values
public static UIFactory.Colors[] 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 (UIFactory.Colors c : UIFactory.Colors.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static UIFactory.Colors valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
valueOfByPreferencesName
public static UIFactory.Colors valueOfByPreferencesName(java.lang.String prefsName)
Find Colors by color preferences name.- Parameters:
prefsName- Color preferences name (e.g. "colors.input.default")- Returns:
- Colors associated with such preferences name
- Throws:
java.lang.IllegalArgumentException- in case there is no Colors with such name
-
getColorByPreferencesName
public static java.awt.Color getColorByPreferencesName(java.lang.String prefsName)
Get Color by colors preferences name.- Parameters:
prefsName- Color preferences name (e.g. "colors.input.default")- Returns:
- Color if Preferences contain this color. Returns default value if exists
null otherwise
-
getColorsNames
public static java.lang.String[] getColorsNames()
Get array with all colors names used in preferences- Returns:
- Names array
-
decodeRGBA
public static java.awt.Color decodeRGBA(java.lang.String color)
-
encodeARGB
public static java.lang.String encodeARGB(java.awt.Color color)
-
isConfigurable
public boolean isConfigurable()
-
getDefaultValue
public java.lang.String getDefaultValue()
Getter for default String-encoded color value. Is used for Color.decode() and should be formatted similarly- Returns:
- Default String-encoded color value
-
getValue
public java.awt.Color getValue()
Getter for current color value. It is loaded from preferences if no color is set previously.- Returns:
- Current color value
-
setValue
public java.awt.Color setValue(java.awt.Color c)
Setter for current color value.- Returns:
- Old color value
-
getPreferencesName
public java.lang.String getPreferencesName()
Get color name used in preferences file. It is formed from enum name. E.g. colors.input.invalid for INPUT_INVALID- Returns:
- Color name used in preferences file
-
readColorFromPreferences
public java.awt.Color readColorFromPreferences()
Read color value from preferences ignoring current color value that is returned by getValue();- Returns:
- Color value from preferences file
-
-