public interface ValidationUI
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 Problem
s 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.
Modifier and Type | Field and Description |
---|---|
static ValidationUI |
NO_OP
Access a ValidationUI instance that does nothing.
|
Modifier and Type | Method and Description |
---|---|
void |
clearProblem()
Clear the problem shown in this UI.
|
void |
showProblem(Problem problem)
Sets the
Problem to be displayed to the user. |
static final ValidationUI NO_OP
void showProblem(Problem problem)
Problem
to 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).problem
- A problem that the user should be shown, which may
affect the state of the UI as a whole. Should never be null.void clearProblem()