Package com.sun.javatest.tool
Class I18NUtils
- java.lang.Object
-
- com.sun.javatest.tool.I18NUtils
-
public class I18NUtils extends java.lang.Object
Utility class to get general internationalization properties and perform general transformations.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ERROR
A convenience redefinition ofStatus.ERROR
.static int
FAILED
A convenience redefinition ofStatus.FAILED
.static int
FILTERED_OUT
A constant indicating that an icon should be represented as "filtered out".static int
NOT_RUN
A convenience redefinition ofStatus.NOT_RUN
.static int
NUM_STATES
A constant indicating the number of different value "state" values.static int
PASSED
A convenience redefinition ofStatus.PASSED
.
-
Constructor Summary
Constructors Constructor Description I18NUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.Color
getStatusBarColor(int status)
Get the color for a bar for a test status.static java.awt.Color
getStatusColor(int status)
Get the base color for a test status.static java.lang.String
getStatusMessage(Status status)
Get localized version of the message string.static java.lang.String
getStatusString(int status)
Get the localized status string for a particular test status.static java.awt.Color
lighter(java.awt.Color c)
Create a color derived from the given color, but lighter.
-
-
-
Field Detail
-
PASSED
public static final int PASSED
A convenience redefinition ofStatus.PASSED
.- See Also:
- Constant Field Values
-
FAILED
public static final int FAILED
A convenience redefinition ofStatus.FAILED
.- See Also:
- Constant Field Values
-
ERROR
public static final int ERROR
A convenience redefinition ofStatus.ERROR
.- See Also:
- Constant Field Values
-
NOT_RUN
public static final int NOT_RUN
A convenience redefinition ofStatus.NOT_RUN
.- See Also:
- Constant Field Values
-
FILTERED_OUT
public static final int FILTERED_OUT
A constant indicating that an icon should be represented as "filtered out".- See Also:
- Constant Field Values
-
NUM_STATES
public static final int NUM_STATES
A constant indicating the number of different value "state" values.- See Also:
- Constant Field Values
-
-
Method Detail
-
getStatusColor
public static java.awt.Color getStatusColor(int status)
Get the base color for a test status.
-
getStatusBarColor
public static java.awt.Color getStatusBarColor(int status)
Get the color for a bar for a test status.
-
getStatusString
public static java.lang.String getStatusString(int status)
Get the localized status string for a particular test status.
-
getStatusMessage
public static java.lang.String getStatusMessage(Status status)
Get localized version of the message string. This includes a localized version of the status (e.g. "Passed") and the raw status message.- Parameters:
status
- The status object for format. May not be null.- Returns:
- A formatted, internationalized string representation of the status object (state and reason).
- See Also:
Status.getReason()
-
lighter
public static java.awt.Color lighter(java.awt.Color c)
Create a color derived from the given color, but lighter. This is currently done by decreasing it's saturation and brightness.- Parameters:
c
- The color to lighten.- Returns:
- The derived color.
-
-