Package net.sf.jguiraffe.gui.builder.window.ctrl
This package contains classes and interfaces for the implementation of form controllers.
Dealing with a form is typically a tedious task. When the GUI is setup, a lot of tasks have to be performed for correctly handling user input: the input fields of the form have to be filled with their initial values, user input has to be validated, fields containing invalid data have to be marked somehow, committing the form is only allowed if all entered data is valid, and so on.
This package defines a form controller base class that addresses these problems. In collaboration with a bunch of helper classes, a form controller is able to manage the whole life cycle of a form:
- When the form is opened, its fields are initialized using the values of the associated form bean. The form bean serves as the model of the form. It can be passed to the builder.
- During editing of the form by the user, a
FormValidationTrigger
determines when a validation has to be performed. This could for instance be any time the user leaves an input field. Of course, if the user hits the OK button to close the form, a validation will always be initiated. - A
FieldMarker
is responsible for changing the display properties of an input field depending on its current validation status. A concrete implementation could for instance paint the background of input fields containing invalid data in a different color. - When the form is finally closed and all entered data is valid, the content of the form has to be written back into its model. Then typically an application-specific action has to be performed, e.g. to persist the changes in a database or something like that.
The main FormController
class is the central point for implementing
this functionality. In most cases, it should be possible to use this class out
of the box. Application-specific logic can be injected by specifying configuration
objects when the controller is created. Adaptations to the specific look and
feel of a concrete application can be achieved by providing different
implementations of the helper objects involved.
$Id: package.html 205 2012-01-29 18:29:57Z oheger $
-
Interface Summary Interface Description FormControllerFieldStatusListener A specialized event listener interface to be implemented by objects that are interested in status updates of form fields.FormControllerFormListener An event listener for processing events of typeFormControllerFormEvent
.FormControllerValidationListener Definition of an interface to be implemented by objects that are interested in validation operations performed by aFormController
.FormValidationTrigger Definition of an interface for objects that can trigger the validation of a form. -
Class Summary Class Description ColorFieldMarker A specializedFormControllerValidationListener
implementation that can change the colors of fields depending on their validation status.FormController A base class for form controllers.FormControllerEvent A base class for events generated byFormController
.FormControllerFieldStatusEvent A specializedFormControllerEvent
class that is generated whenever a form field changes its visited status.FormControllerFormEvent A specializedFormControllerEvent
class for events related to the form associated with aFormController
.FormControllerValidationEvent A specializedFormControllerEvent
class that is generated when the controller performs a validation.FormValidationTriggerFocus A specializedFormValidationTrigger
implementation that triggers a validation operation whenever the user leaves an input field.FormValidationTriggerNone A specialized implementation of aFormValidationTrigger
that does no triggering at all.ToolTipFieldMarker A specializedFormControllerValidationListener
implementation that is able to adapt the tool tips of input elements for which validation messages are available. -
Enum Summary Enum Description FieldValidationStatus An enumeration class describing the possible validation status values of a form field.FormControllerFormEvent.Type An enumeration class defining the possible types ofFormControllerFormEvent
events.