net.sf.jguiraffe.gui.builder.window.ctrl
Interface FieldMarker

All Known Implementing Classes:
ColorFieldMarker

public interface FieldMarker

Definition of an interface for objects that are able to mark form input fields based on their validation status.

An object implementing this interface is associated with a FormController. The FormController keeps track of the validation status of the fields contained in the current form. Whenever the validation status of an input field changes (e.g. the user visits the field for the first time and types in some valid or invalid data), the FieldMarker is notified about this change. It can then manipulate the appearance of the affected field to reflect the new status. This way it is possible to display invalid fields in a special way so that the user can see on a single glance, which fields have to be edited.

When the form is opened an initial validation is performed resulting in the initial validation status. Further validations are triggered by another helper object, a FormValidationTrigger. The FieldMarker is invoked after each validation for each field whose status has changed in the meantime.

When the FieldMarker is invoked, it is passed the name of the affected component, its current validation status, its last status, and its WidgetHandler. This should be enough information for changing the fields's appearance accordingly. If more data is required (e.g. a reference to the controller or the ComponentData object), functionality of the dependency injection framework can be used for obtaining references to the required beans.

Version:
$Id: FieldMarker.java 156 2009-03-03 21:04:47Z oheger $
Author:
Oliver Heger

Method Summary
 void markField(java.lang.String name, WidgetHandler widget, FieldValidationStatus status, FieldValidationStatus lastStatus)
          Marks the specified field depending on its validation status.
 

Method Detail

markField

void markField(java.lang.String name,
               WidgetHandler widget,
               FieldValidationStatus status,
               FieldValidationStatus lastStatus)
Marks the specified field depending on its validation status.

Parameters:
name - the name of the field
widget - the WidgetHandler for this field
status - the current validation status
lastStatus - the last known validation status of this field (this can be null if no last status is known, e.g. if an initial validation was performed)


Copyright © 2009 The JGUIraffe Team. All Rights Reserved.