Package org.ka2ddo.yaac.gui
Class TablePersister
java.lang.Object
org.ka2ddo.yaac.gui.TablePersister
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,AncestorListener
,TableColumnModelListener
public class TablePersister
extends Object
implements TableColumnModelListener, PropertyChangeListener, AncestorListener
This class persists changes made to JTable TableColumnModels by the user.
- Author:
- Andrew Pavlin, KA2DDO
-
Method Summary
Modifier and TypeMethodDescriptionvoid
ancestorAdded
(AncestorEvent event) Called when the source or one of its ancestors is made visible either by setVisible(true) being called or by its being added to the component hierarchy.void
ancestorMoved
(AncestorEvent event) Called when either the source or one of its ancestors is moved.void
ancestorRemoved
(AncestorEvent event) Called when the source or one of its ancestors is made invisible either by setVisible(false) being called or by its being remove from the component hierarchy.void
Tells listeners that a column was added to the model.void
Tells listeners that a column was moved due to a margin change.void
Tells listeners that a column was repositioned.void
Tells listeners that a column was removed from the model.void
Tells listeners that the selection model of the TableColumnModel changed.static TablePersister
Get the TablePersister instance.void
This method gets called when a bound property is changed.void
Monitor a table for persisting any column changes.
-
Method Details
-
getInstance
Get the TablePersister instance.- Returns:
- singleton TablePersister
-
register
Monitor a table for persisting any column changes.- Parameters:
table
- JTable to monitorname
- String name to use to remember the changes
-
columnAdded
Tells listeners that a column was added to the model.- Specified by:
columnAdded
in interfaceTableColumnModelListener
-
columnRemoved
Tells listeners that a column was removed from the model.- Specified by:
columnRemoved
in interfaceTableColumnModelListener
-
columnMoved
Tells listeners that a column was repositioned.- Specified by:
columnMoved
in interfaceTableColumnModelListener
-
columnMarginChanged
Tells listeners that a column was moved due to a margin change.- Specified by:
columnMarginChanged
in interfaceTableColumnModelListener
-
columnSelectionChanged
Tells listeners that the selection model of the TableColumnModel changed.- Specified by:
columnSelectionChanged
in interfaceTableColumnModelListener
-
ancestorAdded
Called when the source or one of its ancestors is made visible either by setVisible(true) being called or by its being added to the component hierarchy. The method is only called if the source has actually become visible. For this to be true all its parents must be visible and it must be in a hierarchy rooted at a Window- Specified by:
ancestorAdded
in interfaceAncestorListener
-
ancestorRemoved
Called when the source or one of its ancestors is made invisible either by setVisible(false) being called or by its being remove from the component hierarchy. The method is only called if the source has actually become invisible. For this to be true at least one of its parents must be invisible or it is not in a hierarchy rooted at a Window- Specified by:
ancestorRemoved
in interfaceAncestorListener
-
ancestorMoved
Called when either the source or one of its ancestors is moved.- Specified by:
ancestorMoved
in interfaceAncestorListener
-
propertyChange
This method gets called when a bound property is changed.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
evt
- A PropertyChangeEvent object describing the event source and the property that has changed.
-