Interface ValidationUI
public interface ValidationUI
User interface controller which can show the user one problem. This
could involve showing an icon and some textual info in a status
bar, and/or disabling some OK-button (if the problem is of
Severity.FATAL) etc.
For one ValidationGroup (a group of UI-components
validated together), typically one or a few ValidationUI
instances might be used, but one instance of ValidationUI
should only be used with at most one ValidationGroup -
otherwise a new Problem in one ValidationGroup will
hide any Problems in others.
Also, typically a ValidationUI instance is also used
for decorating each separate GUI-component that has a Problem. The
SwingComponentDecorationFactory is
a factory class creating such ValidationUI instances for decorating
Swing components when there is a validation problem in them.
- Author:
- Tim Boudreau
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValidationUIAccess a ValidationUI instance that does nothing. -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the problem shown in this UI.voidshowProblem(Problem problem) Sets theProblemto be displayed to the user.
-
Field Details
-
NO_OP
Access a ValidationUI instance that does nothing.
-
-
Method Details
-
showProblem
Sets theProblemto be displayed to the user. Depending on the severity of the problem, the user interface may want to block the user from continuing until it is fixed (for example, disabling the Next button in a wizard or the OK button in a dialog).- Parameters:
problem- A problem that the user should be shown, which may affect the state of the UI as a whole. Should never be null.
-
clearProblem
void clearProblem()Clear the problem shown in this UI.
-