public class ToolTipFieldMarker extends Object implements FormControllerValidationListener
A specialized FormControllerValidationListener
implementation that is
able to adapt the tool tips of input elements for which validation messages
are available.
An instance of this class can be registered as validation listener at a
FormController
. Whenever a validation event is received the instance
iterates over the validation results for all input fields. The texts for
error and warning messages are extracted and combined. Then they are set as
additional tool tip for the corresponding input element. This is an easy but
powerful means to give feedback about validation results to the user: the
user just have to move the mouse over a control, and all related validation
messages are displayed.
The tool tip texts produced by this class can be configured by associating an
instance with a FormValidationMessageFormat
object. This object knows
how to translate validation messages to text. It is invoked for each field
with validation messages, and the text produced by it is set as additional
tool tip text.
Implementation note: This class is not thread-safe. An instance can be
associated with a single FormController
only.
Constructor and Description |
---|
ToolTipFieldMarker(FormValidationMessageFormat messageFormat)
Creates a new instance of
ToolTipFieldMarker and initializes it
with the given FormValidationMessageFormat object. |
Modifier and Type | Method and Description |
---|---|
void |
validationPerformed(FormControllerValidationEvent event)
A validation operation has been performed.
|
public ToolTipFieldMarker(FormValidationMessageFormat messageFormat)
ToolTipFieldMarker
and initializes it
with the given FormValidationMessageFormat
object.messageFormat
- the FormValidationMessageFormat
object (must
not be null)IllegalArgumentException
- if the format object is nullpublic void validationPerformed(FormControllerValidationEvent event)
validationPerformed
in interface FormControllerValidationListener
event
- the validation eventCopyright © 2016 The JGUIraffe Team. All rights reserved.