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 interface
FieldChangeTracker.FieldChangeHandler
The 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 void
componentAdded(java.awt.Component component)
Adds theContainerListener
to thecomponent
.protected void
componentRemoved(java.awt.Component component)
Removes theContainerListener
to thecomponent
.static FieldChangeTracker
install(FieldChangeTracker.FieldChangeHandler handler, java.awt.Container container)
boolean
isChanged()
void
resetChanges()
-
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: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
-
isChanged
public boolean isChanged()
-
resetChanges
public void resetChanges()
-
-