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
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
 
Method Summary
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.
 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're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, 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

Method Detail

values

public static final UIFactory.Colors[] values()
Returns an array containing the constants of this enum type, in the order they're 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're 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

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 assosiated 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


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