jfract V1.0a

org.jfract.beanEditor
Class BeanTableEditor

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--org.jfract.beanEditor.BeanTableEditor
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class BeanTableEditor
extends javax.swing.table.AbstractTableModel

The model to edit a bean with a Jtable it can works with any kind of object respecting javaBeans format the properties showed are defined by the instance but not in the super classes just call new JTable (new BeanTableEditor (yourBeanObject))

See Also:
Serialized Form

Field Summary
private  java.lang.Object bean
           
(package private)  java.util.Hashtable beansTable
           
private  org.w3c.dom.Document descriptionDoc
           
(package private)  java.beans.PropertyDescriptor[] descriptor
           
(package private)  java.beans.PropertyDescriptor[] descriptorUtil
           
(package private)  int edPropNumber
           
(package private)  java.lang.reflect.Method[] getMethod
           
private static org.apache.log4j.Category log4j_category
           
(package private)  java.lang.String[] properties
           
(package private)  int propNumber
           
(package private)  java.lang.reflect.Method[] setMethod
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
BeanTableEditor(org.w3c.dom.Document doc)
           
BeanTableEditor(java.lang.Object bean, org.w3c.dom.Document doc)
          build a BeanTableEditor with a javabean bean
 
Method Summary
 void buildProperties()
          rebuild the properties and the methods of the bean setted
 int getColumnCount()
           
 java.lang.String getColumnName(int column)
          Returns a default name for the column using spreadsheet conventions: A, B, C, ...
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
          Returns false.
 boolean isPublished(java.beans.PropertyDescriptor descriptor, java.lang.String[] published)
          test if the property is published
 void setBean(java.lang.Object bean)
          set the bean to be edited
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          This empty implementation is provided so users don't have to implement this method if their data model is not editable.
 java.lang.Object strToObj(java.lang.String string, java.lang.Class class_type)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

log4j_category

private static final org.apache.log4j.Category log4j_category

descriptor

java.beans.PropertyDescriptor[] descriptor

descriptorUtil

java.beans.PropertyDescriptor[] descriptorUtil

setMethod

java.lang.reflect.Method[] setMethod

getMethod

java.lang.reflect.Method[] getMethod

properties

java.lang.String[] properties

beansTable

java.util.Hashtable beansTable

propNumber

int propNumber

edPropNumber

int edPropNumber

bean

private java.lang.Object bean

descriptionDoc

private org.w3c.dom.Document descriptionDoc
Constructor Detail

BeanTableEditor

public BeanTableEditor(org.w3c.dom.Document doc)

BeanTableEditor

public BeanTableEditor(java.lang.Object bean,
                       org.w3c.dom.Document doc)
                throws WrongBeanException
build a BeanTableEditor with a javabean bean
Parameters:
bean - the bean to show
Method Detail

setBean

public void setBean(java.lang.Object bean)
             throws WrongBeanException
set the bean to be edited

buildProperties

public void buildProperties()
rebuild the properties and the methods of the bean setted

isPublished

public boolean isPublished(java.beans.PropertyDescriptor descriptor,
                           java.lang.String[] published)
test if the property is published

getRowCount

public int getRowCount()
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel

getColumnCount

public int getColumnCount()
Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Overrides:
getValueAt in class javax.swing.table.AbstractTableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Returns false. This is the default implementation for all cells.
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
rowIndex - the row being queried
columnIndex - the column being queried
Returns:
false

getColumnName

public java.lang.String getColumnName(int column)
Returns a default name for the column using spreadsheet conventions: A, B, C, ... Z, AA, AB, etc. If column cannot be found, returns an empty string.
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
column - the column being queried
Returns:
a string containing the default name of column

strToObj

public java.lang.Object strToObj(java.lang.String string,
                                 java.lang.Class class_type)

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
This empty implementation is provided so users don't have to implement this method if their data model is not editable.
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
Parameters:
aValue - value to assign to cell
rowIndex - row of cell
columnIndex - column of cell

jfract V1.0a

Generee le 27.09.2002 08:21:59 PM