Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

beantest.property
Class PropertyTableModel  view PropertyTableModel download PropertyTableModel.java

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended bybeantest.property.PropertyTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class PropertyTableModel
extends javax.swing.table.AbstractTableModel

Table model used to obtain property names and values. This model encapsulates an array of PropertyDescriptors.

Version:
1.16 02/27/02

Field Summary
private  java.lang.Object bean
           
private  java.beans.BeanDescriptor beanDescriptor
           
static int COL_NAME
           
static int COL_VALUE
           
private static beantest.util.DescriptorComparator comparator
           
private  int currentFilter
           
private  java.beans.PropertyDescriptor[] descriptors
           
private  java.beans.BeanInfo info
           
private static int NUM_COLUMNS
           
private static java.util.Hashtable propEditors
           
static int SORT_DEF
           
static int SORT_NAME
           
static int SORT_TYPE
           
private  int sortOrder
           
static int VIEW_ALL
           
static int VIEW_BOUND
           
static int VIEW_CONSTRAINED
           
static int VIEW_EXPERT
           
static int VIEW_HIDDEN
           
static int VIEW_PREFERRED
           
static int VIEW_READ_ONLY
           
static int VIEW_STANDARD
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PropertyTableModel()
           
PropertyTableModel(java.lang.Object bean)
           
 
Method Summary
 void filterTable(int view)
          Filters the table to display only properties with specific attributes.
 int getColumnCount()
          Get column count (2: name, value)
 java.awt.Component getCustomizer()
          Gets the customizer for the current object.
 int getFilter()
          Returns the current filter type
 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)
 int getSortOrder()
           
 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
private static void registerPropertyEditors()
          Method which registers property editors for types.
 void setFilter(int filter)
          Sets the current filter of the Properties.
 void setObject(java.lang.Object bean)
          Set the table model to represents the properties of the object.
 void setSortOrder(int sort)
          Sets the current sort order on the data
 void setValue(java.lang.String name, java.lang.Object value)
          added by synopia updates a property
 void setValueAt(java.lang.Object value, int row, int column)
          Set the value of the Values column.
 void sortTable(int sort)
          Sorts the table according to the sort type.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

descriptors

private java.beans.PropertyDescriptor[] descriptors

beanDescriptor

private java.beans.BeanDescriptor beanDescriptor

info

private java.beans.BeanInfo info

bean

private java.lang.Object bean

propEditors

private static java.util.Hashtable propEditors

comparator

private static beantest.util.DescriptorComparator comparator

NUM_COLUMNS

private static final int NUM_COLUMNS
See Also:
Constant Field Values

COL_NAME

public static final int COL_NAME
See Also:
Constant Field Values

COL_VALUE

public static final int COL_VALUE
See Also:
Constant Field Values

VIEW_ALL

public static final int VIEW_ALL
See Also:
Constant Field Values

VIEW_STANDARD

public static final int VIEW_STANDARD
See Also:
Constant Field Values

VIEW_EXPERT

public static final int VIEW_EXPERT
See Also:
Constant Field Values

VIEW_READ_ONLY

public static final int VIEW_READ_ONLY
See Also:
Constant Field Values

VIEW_BOUND

public static final int VIEW_BOUND
See Also:
Constant Field Values

VIEW_CONSTRAINED

public static final int VIEW_CONSTRAINED
See Also:
Constant Field Values

VIEW_HIDDEN

public static final int VIEW_HIDDEN
See Also:
Constant Field Values

VIEW_PREFERRED

public static final int VIEW_PREFERRED
See Also:
Constant Field Values

currentFilter

private int currentFilter

SORT_DEF

public static final int SORT_DEF
See Also:
Constant Field Values

SORT_NAME

public static final int SORT_NAME
See Also:
Constant Field Values

SORT_TYPE

public static final int SORT_TYPE
See Also:
Constant Field Values

sortOrder

private int sortOrder
Constructor Detail

PropertyTableModel

public PropertyTableModel()

PropertyTableModel

public PropertyTableModel(java.lang.Object bean)
Method Detail

setFilter

public void setFilter(int filter)
Sets the current filter of the Properties.


getFilter

public int getFilter()
Returns the current filter type


setSortOrder

public void setSortOrder(int sort)
Sets the current sort order on the data


getSortOrder

public int getSortOrder()

setObject

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


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)


getColumnCount

public int getColumnCount()
Get column count (2: name, value)


isCellEditable

public boolean isCellEditable(int row,
                              int col)
Check if given cell is editable


getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get text value for cell of table


setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int column)
Set the value of the Values column.


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.


sortTable

public void sortTable(int sort)
Sorts the table according to the sort type.


filterTable

public void filterTable(int view)
Filters the table to display only properties with specific attributes. Will sort the table after the data has been filtered.


registerPropertyEditors

private static void registerPropertyEditors()
Method which registers property editors for types.


setValue

public void setValue(java.lang.String name,
                     java.lang.Object value)
added by synopia updates a property