ca.odell.glazedlists.swing
Class EventJXTableModel<E>

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by ca.odell.glazedlists.swing.EventTableModel<E>
          extended by ca.odell.glazedlists.swing.EventJXTableModel<E>
All Implemented Interfaces:
ListEventListener<E>, Serializable, EventListener, TableModel

public class EventJXTableModel<E>
extends EventTableModel<E>

An extension of the EventTableModel for better integration with JXTable.

In particular, this table model implements a different strategy to tranform ListEvents to TableModelEvents. Whereas EventTableModel converts each ListEvent block to a TableModelEvent, EventJXTableModel tries to create only one TableModelEvent for a ListEvent, that does not represent a reorder. If the ListEvent contains multiple blocks, a special data changed TableModelEvent will be fired, indicating that all row data has changed. Note, that such a data changed TableModelEvent can lead to a loss of the table selection.

Author:
Holger Brands
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ca.odell.glazedlists.swing.EventTableModel
source, swingThreadSource
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
EventJXTableModel(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable)
          
EventJXTableModel(EventList<E> source, TableFormat<? super E> tableFormat)
          
 
Method Summary
protected  void handleListChange(ListEvent<E> listChanges)
          Default implementation for converting a ListEvent to TableModelEvents.
 
Methods inherited from class ca.odell.glazedlists.swing.EventTableModel
createSwingThreadProxyList, dispose, getColumnClass, getColumnCount, getColumnName, getElementAt, getMutableTableModelEvent, getRowCount, getTableFormat, getValueAt, isCellEditable, listChanged, setTableFormat, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventJXTableModel

public EventJXTableModel(EventList<E> source,
                         String[] propertyNames,
                         String[] columnLabels,
                         boolean[] writable)


EventJXTableModel

public EventJXTableModel(EventList<E> source,
                         TableFormat<? super E> tableFormat)

Method Detail

handleListChange

protected void handleListChange(ListEvent<E> listChanges)
Default implementation for converting a ListEvent to TableModelEvents. There will be one TableModelEvent per ListEvent block. Subclasses may choose to implement a different conversion.

Overrides:
handleListChange in class EventTableModel<E>
Parameters:
listChanges - ListEvent to translate


Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by James Lemieux at 2009-01-25 18:40