Class FieldChangeTracker
- java.lang.Object
-
- io.github.jonestimd.swing.validation.ContainerTracker
-
- io.github.jonestimd.swing.validation.FieldChangeTracker
-
public class FieldChangeTracker extends ContainerTracker
This class tracks changes to input fields within a component hierarchy and notifies a listener when any of the input fields has been modified. It can be used to enable a save action when some of the fields on a form have been modified.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFieldChangeTracker.FieldChangeHandlerThe interface for receiving notifications when the form has changes.
-
Constructor Summary
Constructors Constructor Description FieldChangeTracker(FieldChangeTracker.FieldChangeHandler 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.static FieldChangeTrackerinstall(FieldChangeTracker.FieldChangeHandler handler, java.awt.Container container)booleanisChanged()voidresetChanges()-
Methods inherited from class io.github.jonestimd.swing.validation.ContainerTracker
trackFieldChanges, untrackFieldChanges
-
-
-
-
Constructor Detail
-
FieldChangeTracker
public FieldChangeTracker(FieldChangeTracker.FieldChangeHandler handler)
-
-
Method Detail
-
install
public static FieldChangeTracker install(FieldChangeTracker.FieldChangeHandler handler, java.awt.Container container)
-
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
-
isChanged
public boolean isChanged()
-
resetChanges
public void resetChanges()
-
-