org.jdesktop.dataset.event
Class DataTableEventAdapter

java.lang.Object
  extended by org.jdesktop.dataset.event.DataTableEventAdapter
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, DataTableListener

public abstract class DataTableEventAdapter
extends java.lang.Object
implements DataTableListener, java.beans.PropertyChangeListener

DataTableEventAdapter is a DataTableListener that captures TableChangeEvents and RowChangeEvents and re-directs them to handler methods by event type. For example, you can capture a rowAdded(TableChangeEvent) or rowStatusChanged(RowChangeEvent) event instead of checking for the event type on capturing an event directly. To use this class, create an instance and assign it to a DataTable using DataTable.addDataTableListener(DataTableListener).

Author:
Patrick Wright

Constructor Summary
DataTableEventAdapter()
          Creates a new instance of DataTableEventAdapter
 
Method Summary
 void cellChanged(RowChangeEvent evt)
          Fired when a cell's value changes.
 void columnAdded(TableChangeEvent evt)
          Fired when a column is added to the table.
 void columnRemoved(TableChangeEvent evt)
          Fired when a column is removed from the table.
 void propertyChange(java.beans.PropertyChangeEvent evt)
          Fired when a property on the bound object is changed.
 void rowAdded(TableChangeEvent evt)
          Fired when a row is added to the table.
 void rowChanged(RowChangeEvent evt)
          Fired when the row is changed, either status change or a cell's value was changed.
 void rowDeleted(TableChangeEvent evt)
          Fired when a row is deleted from the table.
 void rowDiscarded(TableChangeEvent evt)
          Fired when a row is discarded from the table.
 void rowStatusChanged(RowChangeEvent evt)
          Fired when the row's status changes.
 void tableChanged(TableChangeEvent evt)
          Fired when the table is changed, either structurally (columns added or removed) or in data (rows added, removed, etc.)
 void tableCleared(TableChangeEvent evt)
          Fired when the table is completely cleared.
 void tableLoadComplete(TableChangeEvent evt)
          Fired after a DataProvider finishes loading the table.
 void tableLoadStarted(TableChangeEvent evt)
          Fired right before a DataProvider begins loading the table.
 void tableSaveComplete(TableChangeEvent evt)
          Fired after a DataProvider finishes saving the table.
 void tableSaveStarted(TableChangeEvent evt)
          Fired right before a DataProvider begins saving the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTableEventAdapter

public DataTableEventAdapter()
Creates a new instance of DataTableEventAdapter

Method Detail

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Fired when a property on the bound object is changed. In this case, we are only interested in status changes on a DataRow; these are forwarded to rowStatusChanged(RowChangeEvent). All other property changes are ignored.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

rowChanged

public void rowChanged(RowChangeEvent evt)
Fired when the row is changed, either status change or a cell's value was changed.

Specified by:
rowChanged in interface DataTableListener
Parameters:
evt - The RowChangeEvent capturing the change.

rowStatusChanged

public void rowStatusChanged(RowChangeEvent evt)
Fired when the row's status changes.

Parameters:
evt - The RowChangeEvent capturing the change.

cellChanged

public void cellChanged(RowChangeEvent evt)
Fired when a cell's value changes.

Parameters:
evt - The RowChangeEvent capturing the change.

tableChanged

public void tableChanged(TableChangeEvent evt)
Fired when the table is changed, either structurally (columns added or removed) or in data (rows added, removed, etc.)

Specified by:
tableChanged in interface DataTableListener
Parameters:
evt - The TableChangeEvent capturing the change.

tableLoadStarted

public void tableLoadStarted(TableChangeEvent evt)
Fired right before a DataProvider begins loading the table.

Parameters:
evt - The TableChangeEvent capturing the change.

tableLoadComplete

public void tableLoadComplete(TableChangeEvent evt)
Fired after a DataProvider finishes loading the table.

Parameters:
evt - The TableChangeEvent capturing the change.

tableSaveStarted

public void tableSaveStarted(TableChangeEvent evt)
Fired right before a DataProvider begins saving the table.

Parameters:
evt - The TableChangeEvent capturing the change.

tableSaveComplete

public void tableSaveComplete(TableChangeEvent evt)
Fired after a DataProvider finishes saving the table.

Parameters:
evt - The TableChangeEvent capturing the change.

tableCleared

public void tableCleared(TableChangeEvent evt)
Fired when the table is completely cleared.

Parameters:
evt - The TableChangeEvent capturing the change.

rowAdded

public void rowAdded(TableChangeEvent evt)
Fired when a row is added to the table.

Parameters:
evt - The TableChangeEvent capturing the change.

rowDeleted

public void rowDeleted(TableChangeEvent evt)
Fired when a row is deleted from the table.

Parameters:
evt - The TableChangeEvent capturing the change.

rowDiscarded

public void rowDiscarded(TableChangeEvent evt)
Fired when a row is discarded from the table.

Parameters:
evt - The TableChangeEvent capturing the change.

columnAdded

public void columnAdded(TableChangeEvent evt)
Fired when a column is added to the table.

Parameters:
evt - The TableChangeEvent capturing the change.

columnRemoved

public void columnRemoved(TableChangeEvent evt)
Fired when a column is removed from the table.

Parameters:
evt - The TableChangeEvent capturing the change.


Copyright © 2005 Sun Microsystems All Rights Reserved.