DESY ACOP Beans Home

com.cosylab.gui.components.introspection
Class BeanPropertiesTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.cosylab.gui.components.introspection.PropertiesTableModel
          extended by com.cosylab.gui.components.introspection.BeanPropertiesTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class BeanPropertiesTableModel
extends PropertiesTableModel

BeanPropertiesTableModel is table model which displayes properties of a bean and allows property manipulation based on introspection. This implementationis build around PropertiesTableModel with help of BeanIntrospector.

When value in table is changed, new value is only stored in model. To set all property values to bean use applyProperties method.

Since:
May 19, 2004.
Version:
$Id: BeanPropertiesTableModel.java,v 1.4 2008-04-22 12:28:41 jbobnar Exp $
Author:
Igor Kriznar
See Also:
PropertiesTableModel, BeanIntrospector, Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
BeanPropertiesTableModel()
          Default constructor creates empty model.
BeanPropertiesTableModel(java.lang.Object bean, java.lang.String[] names)
          Creates new model with specifies bean and property names, which model will display in table and manipulate
 
Method Summary
 void applyProperties()
          Sets all in model stored property values to the bean.
 java.lang.Object getBean()
          Returns bean for which properties apply.
 void setBean(java.lang.Object bean)
          Sets the bean for which properties apply.
 
Methods inherited from class com.cosylab.gui.components.introspection.PropertiesTableModel
containsProperty, findColumn, getColumnCount, getColumnName, getPropertyNames, getPropertyTypes, getPropertyValues, getRowCount, getTypeForRow, getValueAt, isCellEditable, isEditable, isTypeShowing, setEditable, setPropertyNames, setPropertyTypes, setPropertyValues, setTypeShowing, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanPropertiesTableModel

public BeanPropertiesTableModel()
Default constructor creates empty model.


BeanPropertiesTableModel

public BeanPropertiesTableModel(java.lang.Object bean,
                                java.lang.String[] names)
Creates new model with specifies bean and property names, which model will display in table and manipulate

Parameters:
bean -
names -
Method Detail

applyProperties

public void applyProperties()
                     throws java.lang.IllegalArgumentException,
                            java.lang.IllegalAccessException,
                            java.lang.reflect.InvocationTargetException,
                            java.lang.NoSuchMethodException,
                            java.beans.IntrospectionException
Sets all in model stored property values to the bean.

Throws:
java.lang.IllegalArgumentException - if introspection manipulation failed
java.lang.IllegalAccessException - if introspection manipulation failed
java.lang.reflect.InvocationTargetException - if introspection manipulation failed
java.lang.NoSuchMethodException - if introspection manipulation failed
java.beans.IntrospectionException - if introspection manipulation failed
java.lang.NullPointerException - if bean was not set

getBean

public java.lang.Object getBean()
Returns bean for which properties apply.

Returns:
bean for which properties apply

setBean

public void setBean(java.lang.Object bean)
Sets the bean for which properties apply.

Parameters:
bean - new bean object


Copyright © 2010. All Rights Reserved.