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 theValidatedComponents 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 interfaceValidationTracker.ValidationChangeHandlerThe 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 voidcomponentAdded(java.awt.Component component)Adds theContainerListenerto thecomponent.protected voidcomponentRemoved(java.awt.Component component)Removes theContainerListenerto thecomponent.java.util.Collection<java.lang.String>getValidationMessages()static ValidationTrackerinstall(ValidationTracker.ValidationChangeHandler handler, java.awt.Container container)voidtrackFieldChanges(java.awt.Container container)Adds theContainerListenerto thecontainerand any of its nested containers.voiduntrackFieldChanges(java.awt.Container container)Removes theContainerListenerfrom thecontainerand 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:ContainerTrackerAdds theContainerListenerto thecontainerand any of its nested containers.- Overrides:
trackFieldChangesin classContainerTracker
-
untrackFieldChanges
public void untrackFieldChanges(java.awt.Container container)
Description copied from class:ContainerTrackerRemoves theContainerListenerfrom thecontainerand any of its nested containers.- Overrides:
untrackFieldChangesin classContainerTracker
-
componentAdded
protected void componentAdded(java.awt.Component component)
Description copied from class:ContainerTrackerAdds theContainerListenerto thecomponent.- Overrides:
componentAddedin classContainerTracker
-
componentRemoved
protected void componentRemoved(java.awt.Component component)
Description copied from class:ContainerTrackerRemoves theContainerListenerto thecomponent.- Overrides:
componentRemovedin classContainerTracker
-
getValidationMessages
public java.util.Collection<java.lang.String> getValidationMessages()
-
-