org.ocd.dcf.property
Class PropertyTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--org.ocd.dcf.property.PropertyTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class PropertyTableModel
extends javax.swing.table.AbstractTableModel

See Also:
Serialized Form

Field Summary
static int COL_NAME
           
static int COL_VALUE
           
static int VIEW_ALL
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PropertyTableModel()
          Create the Model for Editing a Beans Properties Call setObject to set the object to modify
PropertyTableModel(java.lang.Object bean)
          Create the Model for Editing a Beans Properties
 
Method Summary
 int getColumnCount()
          Get column count (2: name, value)
 java.awt.Component getCustomizer()
          Gets the customizer for the current object.
 java.lang.Object getObject()
          Return the current object that is represented by this model.
 java.beans.PropertyDescriptor getPropertyDescriptor(int row)
          Returns the PropertyDescriptor for the row.
 java.beans.PropertyEditor getPropertyEditor(int row)
          Returns a new instance of the property editor for a given class.
 java.lang.Class getPropertyType(int row)
          Returns the Java type info for the property at the given row.
 int getRowCount()
          Get row count (total number of properties shown)
 java.lang.Object getValueAt(int row, int col)
          Get text value for cell of table
 boolean hasCustomizer()
          Returns a flag indicating if the encapsulated object has a customizer.
 boolean isCellEditable(int row, int col)
          Check if given cell is editable
 void resetOriginalValues(java.util.Set propNames)
          Reset the Values of the Bean to their originals
 void setObject(java.lang.Object bean)
          Set the table model to represents the properties of the object.
 void setValueAt(java.lang.Object value, int row, int column)
          Set the value of the Values column.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COL_NAME

public static final int COL_NAME

COL_VALUE

public static final int COL_VALUE

VIEW_ALL

public static final int VIEW_ALL
Constructor Detail

PropertyTableModel

public PropertyTableModel()
Create the Model for Editing a Beans Properties Call setObject to set the object to modify

PropertyTableModel

public PropertyTableModel(java.lang.Object bean)
Create the Model for Editing a Beans Properties
Parameters:
bean - to modify
Method Detail

setObject

public void setObject(java.lang.Object bean)
Set the table model to represents the properties of the object.

resetOriginalValues

public void resetOriginalValues(java.util.Set propNames)
Reset the Values of the Bean to their originals
Parameters:
Set - of property Names to revert

getObject

public java.lang.Object getObject()
Return the current object that is represented by this model.

getRowCount

public int getRowCount()
Get row count (total number of properties shown)
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel

getColumnCount

public int getColumnCount()
Get column count (2: name, value)
Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Check if given cell is editable
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
row - table row
col - table column

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get text value for cell of table
Overrides:
getValueAt in class javax.swing.table.AbstractTableModel
Parameters:
row - table row
col - table column

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int column)
Set the value of the Values column.
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getPropertyType

public java.lang.Class getPropertyType(int row)
Returns the Java type info for the property at the given row.

getPropertyDescriptor

public java.beans.PropertyDescriptor getPropertyDescriptor(int row)
Returns the PropertyDescriptor for the row.

getPropertyEditor

public java.beans.PropertyEditor getPropertyEditor(int row)
Returns a new instance of the property editor for a given class. If an editor is not specified in the property descriptor then it is looked up in the PropertyEditorManager.

hasCustomizer

public boolean hasCustomizer()
Returns a flag indicating if the encapsulated object has a customizer.

getCustomizer

public java.awt.Component getCustomizer()
Gets the customizer for the current object.
Returns:
New instance of the customizer or null if there isn't a customizer.