FileDocCategorySizeDatePackage
UtilComponent.javaAPI DocExample2173Sat Nov 16 13:03:30 GMT 2002com.oreilly.javaxp.junit

UtilComponent

public class UtilComponent extends Object
author
Eric M. Burke
version
$Id: UtilComponent.java,v 1.1 2002/11/16 20:03:31 jepc Exp $

Fields Summary
public static final int
ADD_MODE
public static final int
RECORD_AVAILABLE_MODE
public static final int
NO_RECORD_AVAILABLE_MODE
public static final int
KEY_FIELD
public static final int
REQUIRED_FIELD
public static final int
READONLY_FIELD
public static final int
NORMAL_FIELD
public static final Color
FIELD_NORMAL_BACKGROUND
public static final Color
FIELD_ERROR_BACKGROUND
public static final Color
FIELD_REQUIRED_BACKGROUND
public static final Color
FIELD_DISABLED_BACKGROUND
Constructors Summary
Methods Summary
public static java.lang.StringcolorToString(java.awt.Color color)

        if (color == null) {
            return "null";
        }
        if (color.equals(FIELD_DISABLED_BACKGROUND)) {
            return "FIELD_DISABLED_BACKGROUND";
        }
        if (color.equals(FIELD_ERROR_BACKGROUND)) {
            return "FIELD_ERROR_BACKGROUND";
        }
        if (color.equals(FIELD_REQUIRED_BACKGROUND)) {
            return "FIELD_REQUIRED_BACKGROUND";
        }
        if (color.equals(FIELD_NORMAL_BACKGROUND)) {
            return "FIELD_NORMAL_BACKGROUND";
        }
        return color.toString();
    
public static java.awt.ColorgetFieldBackground(int screenMode, int fieldType, boolean valid, boolean requiredConditionMet)


       
             
             
             
              
        if (fieldType == READONLY_FIELD
                || screenMode == NO_RECORD_AVAILABLE_MODE
                || (fieldType == KEY_FIELD && screenMode != ADD_MODE)) {
            return FIELD_DISABLED_BACKGROUND;
        }

        if (!valid) {
            return FIELD_ERROR_BACKGROUND;
        }
        if ((fieldType == KEY_FIELD || fieldType == REQUIRED_FIELD)
                && !requiredConditionMet) {
            return FIELD_REQUIRED_BACKGROUND;
        }
        return FIELD_NORMAL_BACKGROUND;