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
| 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 |
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
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
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 queriedcolumnIndex - 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 cellrowIndex - row of cellcolumnIndex - column of cell
Generee le 27.09.2002 08:21:59 PM