com.sun.javatest.tool
Enum UIFactory.Colors

java.lang.Object
  extended by java.lang.Enum<UIFactory.Colors>
      extended by 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
BLACK
           
BUTTON_DISABLED_FOREGROUND
           
CONTROL_INFO
           
CONTROL_SHADOW
           
INPUT_DEFAULT
          Default background color for input fields
INPUT_INVALID
          Color used for highlighting incorrect input fields
INPUT_VALID
          Color used for highlighting correct input fields
MENU_BACKGROUND
           
PRIMARY_CONTROL
           
PRIMARY_CONTROL_DARK_SHADOW
           
PRIMARY_CONTROL_HIGHLIGHT
           
PRIMARY_CONTROL_INFO
           
PRIMARY_CONTROL_SHADOW
           
SEPARATOR_FOREGROUND
           
TEXT_COLOR
           
TEXT_HIGHLIGHT_COLOR
           
TEXT_SELECTED_COLOR
           
TRANSPARENT
           
WINDOW_BACKGROUND
           
 
Method Summary
static java.awt.Color decodeRGBA(java.lang.String color)
           
static java.lang.String encodeARGB(java.awt.Color color)
           
static java.awt.Color getColorByPreferencesName(java.lang.String prefsName)
          Get Color by colors preferences name.
static java.lang.String[] getColorsNames()
          Get array with all colors names used in preferences
 java.lang.String getDefaultValue()
          Getter for default String-encoded color value.
 java.lang.String getPreferencesName()
          Get color name used in preferences file.
 java.awt.Color getValue()
          Getter for current color value.
 boolean isConfigurable()
           
 java.awt.Color readColorFromPreferences()
          Read color value from preferences ignoring current color value that is returned by getValue();
 java.awt.Color setValue(java.awt.Color c)
          Setter for current color value.
static UIFactory.Colors valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static UIFactory.Colors valueOfByPreferencesName(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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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 name
java.lang.NullPointerException - if the argument is null

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

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)
                                 throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

encodeARGB

public static java.lang.String encodeARGB(java.awt.Color color)


Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.