ar.com.da.swing
Class BeanCollectionTableModel

java.lang.Object
  extended by ar.com.da.swing.BeanCollectionTableModel
All Implemented Interfaces:
javax.swing.table.TableModel

public class BeanCollectionTableModel
extends java.lang.Object
implements javax.swing.table.TableModel

A table model that wraps a collection of beans

Author:
Carlos E.Descalzi

Constructor Summary
BeanCollectionTableModel(java.lang.Class itemClass, java.util.Collection<?> items, java.lang.String... propertyNames)
          Constructs a new model using a given item class,a data collection and the properties to show
BeanCollectionTableModel(java.lang.Class itemClass, java.lang.String... propertyNames)
          Constructs a new model using a given item class and the properties to show
 
Method Summary
 void add(java.lang.Object item)
           
 void addTableModelListener(javax.swing.event.TableModelListener l)
           
 java.lang.Class<?> getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int columnIndex)
           
 java.lang.String[] getPropertyNames()
           
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void remove(int index)
           
 void remove(java.lang.Object item)
           
 void removeTableModelListener(javax.swing.event.TableModelListener l)
           
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanCollectionTableModel

public BeanCollectionTableModel(java.lang.Class itemClass,
                                java.lang.String... propertyNames)
Constructs a new model using a given item class and the properties to show

Parameters:
itemClass -
propertyNames -

BeanCollectionTableModel

public BeanCollectionTableModel(java.lang.Class itemClass,
                                java.util.Collection<?> items,
                                java.lang.String... propertyNames)
Constructs a new model using a given item class,a data collection and the properties to show

Parameters:
itemClass -
items -
propertyNames -
Method Detail

getPropertyNames

public java.lang.String[] getPropertyNames()

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel

getColumnName

public java.lang.String getColumnName(int columnIndex)
Specified by:
getColumnName in interface javax.swing.table.TableModel

getColumnClass

public java.lang.Class<?> getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface javax.swing.table.TableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface javax.swing.table.TableModel

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Specified by:
getValueAt in interface javax.swing.table.TableModel

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface javax.swing.table.TableModel

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
addTableModelListener in interface javax.swing.table.TableModel

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener l)
Specified by:
removeTableModelListener in interface javax.swing.table.TableModel

add

public void add(java.lang.Object item)

remove

public void remove(java.lang.Object item)

remove

public void remove(int index)


Copyright © 2006 null. All Rights Reserved.