org.viewaframework.binding.swing.table
Class TableBindingModel<U>

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.viewaframework.binding.swing.table.TableBindingModel<U>
Type Parameters:
U -
All Implemented Interfaces:
Serializable, TableModel, Observable, ObservableModel<U>

public class TableBindingModel<U>
extends AbstractTableModel
implements ObservableModel<U>

Author:
Mario Garcia
See Also:
Serialized Form

Field Summary
static String SELECTED_ITEM
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TableBindingModel(JTable table, EventList<U> elementList, List<ColumnInfo> columns)
           
TableBindingModel(JTable table, List<ColumnInfo> columns)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          This method adds listeners registering all modifications made to registered properties.
 boolean contains(U element)
           
 void firePropertyChange(PropertyChangeEvent evt)
          Fires an event of a specific property
 Class<?> getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 String getColumnPropertyName(int column)
           
 EventList<U> getModelList()
           
 List<PropertyChangeListener> getPropertyChangeListeners()
          Returns a list of PropertyChangeListener objects
 U getRow(int rowIndex)
           
 int getRowCount()
           
 BeanAdapter<U> getSelectedElementAdapter()
           
 U getSelectedItem()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 void removePropertyChangeListener(PropertyChangeListener listener)
          This method removes listeners registering all modifications made to registered properties.
 void setModelList(EventList<U> modelList)
           
 void setSelectedItem(Object anItem)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECTED_ITEM

public static final String SELECTED_ITEM
See Also:
Constant Field Values
Constructor Detail

TableBindingModel

public TableBindingModel(JTable table,
                         EventList<U> elementList,
                         List<ColumnInfo> columns)
Parameters:
elementList -
visibleProperties -

TableBindingModel

public TableBindingModel(JTable table,
                         List<ColumnInfo> columns)
Parameters:
visibleProperties -
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: Observable
This method adds listeners registering all modifications made to registered properties.

Specified by:
addPropertyChangeListener in interface Observable

contains

public boolean contains(U element)
Specified by:
contains in interface ObservableModel<U>

firePropertyChange

public void firePropertyChange(PropertyChangeEvent evt)
Description copied from interface: Observable
Fires an event of a specific property

Specified by:
firePropertyChange in interface Observable
Parameters:
evt - Triggered event

getColumnClass

public Class<?> getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

getColumnPropertyName

public String getColumnPropertyName(int column)
Parameters:
column -
Returns:

getModelList

public EventList<U> getModelList()
Specified by:
getModelList in interface ObservableModel<U>

getPropertyChangeListeners

public List<PropertyChangeListener> getPropertyChangeListeners()
Description copied from interface: Observable
Returns a list of PropertyChangeListener objects

Specified by:
getPropertyChangeListeners in interface Observable
Returns:
PropertyChangeListener list

getRow

public U getRow(int rowIndex)
Parameters:
rowIndex -
Returns:

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getSelectedElementAdapter

public BeanAdapter<U> getSelectedElementAdapter()
Specified by:
getSelectedElementAdapter in interface ObservableModel<U>

getSelectedItem

public U getSelectedItem()
Returns:

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: Observable
This method removes listeners registering all modifications made to registered properties.

Specified by:
removePropertyChangeListener in interface Observable

setModelList

public void setModelList(EventList<U> modelList)
Specified by:
setModelList in interface ObservableModel<U>

setSelectedItem

public void setSelectedItem(Object anItem)
Parameters:
selectedObject -


Copyright © 2010. All Rights Reserved.