Package Class Use Tree Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
java.lang.Objectjavax.swing.table.AbstractTableModel
jve.generated.SwingTableBinder
Swing implementation of the ITableBinder interface. This class acts as a model for a Swing JTable. It allows the sorting and filtering of JTable's contents. The SwingTableBinder also exports the selected row's element as a DataObject.
The SwingTableBinder cannot be used directly, rather its subclasses JRowTableBinder or JObjectTableBinder should be used depending on the source of array data the table is bound to.
Nested Class Summary class SwingTableBinder.SwingTableSelectionChangedEvent
The type of event that is fired when the table's selection changes.
Nested classes inherited from class jve.generated.ITableBinder ITableBinder.SelectionChangedEvent, ITableBinder.SelectionChangedListener
Field Summary static int ASCENDING
static int DESCENDING
protected java.util.List listeners
protected java.lang.String[] modelHeaders
protected java.util.List modelProperties
protected java.lang.Object[] modelRows
protected java.util.HashMap modelToSourceIndex
static int NOT_SORTED
java.util.Comparator rowSortComparitor
protected java.util.HashMap rowToValue
protected IDataObject selectedRowDataObject
protected java.util.HashMap sourceToModelIndex
protected IFilterBinder tableFilter
protected java.lang.Object[] unSortedModelRows
protected javax.swing.JTable visualTable
Fields inherited from class javax.swing.table.AbstractTableModel listenerList
Fields inherited from interface jve.generated.IBoundObject DELIMITER, PROPERTY_OBJ_CHANGED
Constructor Summary SwingTableBinder()
Method Summary void actionPerformed(IActionBinder action)
Respond to an action occuring.void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a PropertyChangeListener to the selected data object.void addSelectionChangedListener(ITableBinder.SelectionChangedListener l)
Add a listener for table selection changesvoid addTableModelListener(javax.swing.event.TableModelListener l)
Add a table model listener to the listener list.protected void clearModel()
Clear out all cached information stored in the binder.protected void fireSelectionChanged(ITableBinder.SelectionChangedEvent e)
Notify all SelectionChangedListeners that the selection on the table has changed.protected abstract IBoundObject getBoundObject()
Get the object this table is bound to.int getColumnCount()
Get the number of columns available for the table.java.lang.String getColumnName(int column)
Get the default name of the column at the given index.int getDataIndexFromVisualIndex(int index)
Get the index of the row data associated with this table binder that corresponds to the given index in the visual table.IFilterBinder getFilter()
Get the filter used by this table.protected javax.swing.Icon getHeaderRendererIcon(int column, int size)
Get the sorting icon for the given column.java.lang.Object getObject()
Get the selected row in the visual table.java.lang.String getProperty()
There is no bound property on a SwingTableBinder.int getRowCount()
Get the number of rows in the table.protected java.lang.Object[] getRows()
Get the row data to display in the table.int getSelectedIndex()
This returns the index of the selected row in the visual table.java.lang.Object getSelectedObject()
Get the selected object for the currently selected row in the visual table.protected java.lang.String getSortedProperty()
java.lang.Object getSourceObject()
Get the source object that is used to reference the bound object.java.lang.Class getType()
Get the class type of the referenced object.java.lang.Object getValue(java.lang.String property)
Get the value of the given property from the row object that is selected in the visual table.java.lang.Object getValueAt(int rowIndex, int columnIndex)
Get the value of the cell at the given row and column index.java.lang.Object getValueAt(int rowIndex, java.lang.String property)
Get the value of the cell specified by the given row and column propertyint getVisualIndexFromDataIndex(int index)
Get the index of the visual table row that corresponds to the given index in the row data associated with this table binder.boolean isPrimitive(java.lang.String property)
Get to see if the type of the given property is a Java primitive type.boolean isReadOnly(java.lang.String property)
Check if the given property has a setter method.protected void log(java.lang.String s)
protected void log(java.lang.Throwable t)
The log(xxx) methods are called in case of a failure.protected void performFilter()
Filter the rows of the table if a filter is set on this binder.protected void performSort()
Sort the rows of the table.protected abstract java.lang.Object[] primGetRows()
Get the data rows from the bound object.void refresh()
Refresh model data, and re-drive the current selection.void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a PropertyChangeListener from the selected data object.void removeSelectionChangedListener(ITableBinder.SelectionChangedListener l)
Remove an existing table selection listenervoid removeTableModelListener(javax.swing.event.TableModelListener l)
Remove a table model listener from the list.protected void reset(boolean hard)
Respond to the change of the table model (such as changing target rows data source).void setFilter(IFilterBinder filter)
Set a filter to attatch to this table.void setProperty(java.lang.String property)
This method should not be called on a SwingTableBinder.void setSourceObject(java.lang.Object obj)
This method should not be called on a SwingTableBinder.void setSourceObject(java.lang.Object obj, java.lang.String property)
This method should not be called on a SwingTableBinder.void setValue(java.lang.String property, java.lang.Object value)
Change the value of the given property on the selected row object in the table.protected void setVisualTable(javax.swing.JTable table)
Hook up the table binder to work with the given visual table.java.lang.String toString()
protected void updateAllTableColumnIndexes()
Update the table column indexes to match the Z-order of the properties used to define the columns of the table.protected void updateColumnModelIndex(javax.swing.table.TableColumn tc)
Update the modelIndex propert on the table's columns.protected void updateRowInformation()
Cache information regarding the table rows.
Methods inherited from class javax.swing.table.AbstractTableModel findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, setValueAt
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Field Detail
protected javax.swing.JTable visualTable
protected IFilterBinder tableFilter
protected java.lang.Object[] modelRows
protected java.lang.Object[] unSortedModelRows
protected java.util.HashMap modelToSourceIndex
protected java.util.HashMap sourceToModelIndex
protected java.util.HashMap rowToValue
protected java.lang.String[] modelHeaders
protected java.util.List modelProperties
protected java.util.List listeners
protected IDataObject selectedRowDataObject
public static final int NOT_SORTED
public static final int DESCENDING
public static final int ASCENDING
public java.util.Comparator rowSortComparitor
Constructor Detail
public SwingTableBinder()
Method Detail
protected void log(java.lang.Throwable t)
protected void log(java.lang.String s)
protected java.lang.String getSortedProperty()
protected void performSort()
protected javax.swing.Icon getHeaderRendererIcon(int column, int size)
protected void fireSelectionChanged(ITableBinder.SelectionChangedEvent e)
protected void performFilter()
protected abstract IBoundObject getBoundObject()
protected abstract java.lang.Object[] primGetRows()
protected void clearModel()
protected void updateRowInformation() throws java.beans.IntrospectionException
protected java.lang.Object[] getRows()
public void addSelectionChangedListener(ITableBinder.SelectionChangedListener l)
public void removeSelectionChangedListener(ITableBinder.SelectionChangedListener l)
public int getColumnCount()
protected void updateColumnModelIndex(javax.swing.table.TableColumn tc)
protected void updateAllTableColumnIndexes()
public int getRowCount()
public int getSelectedIndex()
public java.lang.Object getSelectedObject()
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
public java.lang.Object getValueAt(int rowIndex, java.lang.String property)
public java.lang.String getColumnName(int column)
protected void setVisualTable(javax.swing.JTable table)
public void addTableModelListener(javax.swing.event.TableModelListener l)
public void removeTableModelListener(javax.swing.event.TableModelListener l)
public void refresh()
public void actionPerformed(IActionBinder action)
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
public java.lang.Object getObject()
public java.lang.Object getSourceObject()
public java.lang.Object getValue(java.lang.String property)
public void setSourceObject(java.lang.Object obj)
public void setSourceObject(java.lang.Object obj, java.lang.String property)
public void setProperty(java.lang.String property)
public java.lang.String getProperty()
public void setValue(java.lang.String property, java.lang.Object value)
public java.lang.String toString()
protected void reset(boolean hard)
public IFilterBinder getFilter()
public void setFilter(IFilterBinder filter)
public java.lang.Class getType()
public int getDataIndexFromVisualIndex(int index)
public int getVisualIndexFromDataIndex(int index)
public boolean isReadOnly(java.lang.String property)
public boolean isPrimitive(java.lang.String property)
Package Class Use Tree Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD