Class ValidationTracker
- java.lang.Object
-
- io.github.jonestimd.swing.validation.ContainerTracker
-
- io.github.jonestimd.swing.validation.ValidationTracker
-
public class ValidationTracker extends ContainerTracker
This class tracks the validation messages for all of theValidatedComponent
s in a component hierarchy. Whenever the list of validation messages changes, a notification is sent to theValidationTracker.ValidationChangeHandler
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ValidationTracker.ValidationChangeHandler
The interface for receiving notification when the validation changes.
-
Constructor Summary
Constructors Constructor Description ValidationTracker(ValidationTracker.ValidationChangeHandler handler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
componentAdded(java.awt.Component component)
Adds theContainerListener
to thecomponent
.protected void
componentRemoved(java.awt.Component component)
Removes theContainerListener
to thecomponent
.java.util.Collection<java.lang.String>
getValidationMessages()
static ValidationTracker
install(ValidationTracker.ValidationChangeHandler handler, java.awt.Container container)
void
trackFieldChanges(java.awt.Container container)
Adds theContainerListener
to thecontainer
and any of its nested containers.void
untrackFieldChanges(java.awt.Container container)
Removes theContainerListener
from thecontainer
and any of its nested containers.
-
-
-
Constructor Detail
-
ValidationTracker
public ValidationTracker(ValidationTracker.ValidationChangeHandler handler)
-
-
Method Detail
-
install
public static ValidationTracker install(ValidationTracker.ValidationChangeHandler handler, java.awt.Container container)
-
trackFieldChanges
public void trackFieldChanges(java.awt.Container container)
Description copied from class:ContainerTracker
Adds theContainerListener
to thecontainer
and any of its nested containers.- Overrides:
trackFieldChanges
in classContainerTracker
-
untrackFieldChanges
public void untrackFieldChanges(java.awt.Container container)
Description copied from class:ContainerTracker
Removes theContainerListener
from thecontainer
and any of its nested containers.- Overrides:
untrackFieldChanges
in classContainerTracker
-
componentAdded
protected void componentAdded(java.awt.Component component)
Description copied from class:ContainerTracker
Adds theContainerListener
to thecomponent
.- Overrides:
componentAdded
in classContainerTracker
-
componentRemoved
protected void componentRemoved(java.awt.Component component)
Description copied from class:ContainerTracker
Removes theContainerListener
to thecomponent
.- Overrides:
componentRemoved
in classContainerTracker
-
getValidationMessages
public java.util.Collection<java.lang.String> getValidationMessages()
-
-