|
||||||||||
| 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
|
static int |
NOT_SORTED
|
java.util.Comparator |
rowSortComparitor
|
| 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 changes |
void |
addTableModelListener(javax.swing.event.TableModelListener l)
Add a table model listener to the listener list. |
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. |
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. |
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. |
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 property |
int |
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. |
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 listener |
void |
removeTableModelListener(javax.swing.event.TableModelListener l)
Remove a table model listener from the list. |
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. |
java.lang.String |
toString()
|
| 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 |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
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 |
public void addSelectionChangedListener(ITableBinder.SelectionChangedListener l)
ITableBinder
addSelectionChangedListener in interface ITableBinderl - the SelectionChangedListenerpublic void removeSelectionChangedListener(ITableBinder.SelectionChangedListener l)
ITableBinder
removeSelectionChangedListener in interface ITableBinderl - the listener to removepublic int getColumnCount()
ITableBinder
getColumnCount in interface ITableBinderpublic int getRowCount()
ITableBinder
getRowCount in interface ITableBinderpublic int getSelectedIndex()
ITableBinder
getSelectedIndex in interface ITableBinderpublic java.lang.Object getSelectedObject()
ITableBinder
getSelectedObject in interface ITableBinder
public java.lang.Object getValueAt(int rowIndex,
int columnIndex)
getValueAt in interface ITableBinderrowIndex - the row indexcolumnIndex - the column index
public java.lang.Object getValueAt(int rowIndex,
java.lang.String property)
getValueAt in interface ITableBinderrowIndex - the row indexproperty - the property of the object at the target row
public java.lang.String getColumnName(int column)
getColumnName in interface ITableBindercolumn - the index of the column to get
public void addTableModelListener(javax.swing.event.TableModelListener l)
addTableModelListener in interface javax.swing.table.TableModell - the listener to addpublic void removeTableModelListener(javax.swing.event.TableModelListener l)
removeTableModelListener in interface javax.swing.table.TableModelpublic void refresh()
refresh in interface IBoundObjectpublic void actionPerformed(IActionBinder action)
actionPerformed in interface IBoundObjectaction - the action that used the referenced objectpublic void addPropertyChangeListener(java.beans.PropertyChangeListener l)
addPropertyChangeListener in interface IBoundObjectl - the listener to add.public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
removePropertyChangeListener in interface IBoundObjectl - the listener to remove.public java.lang.Object getObject()
getObject in interface IBoundObjectpublic java.lang.Object getSourceObject()
IBoundObject
getSourceObject in interface IBoundObjectpublic java.lang.Object getValue(java.lang.String property)
getValue in interface IDataObjectproperty - the property of the row object
public void setSourceObject(java.lang.Object obj)
setSourceObject in interface IBoundObjectobj - the source object
public void setSourceObject(java.lang.Object obj,
java.lang.String property)
setSourceObject in interface IBoundObjectobj - the source objectproperty - the target propertypublic void setProperty(java.lang.String property)
setProperty in interface IBoundObjectproperty - the property of the source objectpublic java.lang.String getProperty()
getProperty in interface IBoundObject
public void setValue(java.lang.String property,
java.lang.Object value)
setValue in interface IDataObjectproperty - the target property of the row objectvalue - the value to setpublic java.lang.String toString()
public IFilterBinder getFilter()
ITableBinder
getFilter in interface ITableBinderpublic void setFilter(IFilterBinder filter)
ITableBinder
setFilter in interface ITableBinderfilter - the filter to use with this table.public java.lang.Class getType()
IBoundObject
getType in interface IBoundObjectpublic int getDataIndexFromVisualIndex(int index)
ITableBinder
getDataIndexFromVisualIndex in interface ITableBinderindex - the row index from the visual table
public int getVisualIndexFromDataIndex(int index)
ITableBinder
getVisualIndexFromDataIndex in interface ITableBinderindex - the row index from the row data
public boolean isReadOnly(java.lang.String property)
IDataObject
isReadOnly in interface IDataObjectproperty - the property to check
public boolean isPrimitive(java.lang.String property)
IDataObject
isPrimitive in interface IDataObjectproperty - the property to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||