Holger's
Java API

com.antelmann.util.table
Class ObjectTableModelWrapper<T>

java.lang.Object
  extended by com.antelmann.util.table.TableModelWrapper
      extended by com.antelmann.util.table.ObjectTableModelWrapper<T>
All Implemented Interfaces:
EditableComponent, Refreshable, ObjectTableModel<T>, TableCustomizer, Wrapped<TableModel>, TableModel

public class ObjectTableModelWrapper<T>
extends TableModelWrapper
implements ObjectTableModel<T>

a wrapper around a TableModel that also supports ObjectTableModel

Author:
han

Field Summary
 
Fields inherited from class com.antelmann.util.table.TableModelWrapper
DATE_CONVERTER
 
Constructor Summary
ObjectTableModelWrapper(ObjectTableModel<T> model)
           
 
Method Summary
 int getRowFor(T entry)
          locates the row where the given entry can be found in this model
 T getRowValue(int row)
          retrieves the value that is represented by the given row in this model.
 void refreshContent()
          refreshes the embedded content
 void setRowValues(Iterable<? extends T> updatedList)
          allows to change the underlying table data based on the given collection.
 ObjectTableModel<T> unwrap()
          returns the embedded instance that this wrapper encloses
 
Methods inherited from class com.antelmann.util.table.TableModelWrapper
addTableModelListener, applyStyle, applyStyleFor, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, isEditable, removeTableModelListener, setColumnClass, setColumnClass, setColumnClassBasedOnRow, setConverter, setConverter, setConverter, setConverter, setEditable, setEditor, setEditor, setReadOnly, setRenderer, setRenderer, setValueAt, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 

Constructor Detail

ObjectTableModelWrapper

public ObjectTableModelWrapper(ObjectTableModel<T> model)
Method Detail

refreshContent

public void refreshContent()
                    throws IOException
Description copied from interface: Refreshable
refreshes the embedded content

Specified by:
refreshContent in interface Refreshable
Throws:
IOException - if the refresh failed

getRowValue

public T getRowValue(int row)
Description copied from interface: ObjectTableModel
retrieves the value that is represented by the given row in this model. If the given row does not exist in the model, various RuntimeExceptions may occur.

Specified by:
getRowValue in interface ObjectTableModel<T>
Returns:
the Object value representing the given row

getRowFor

public int getRowFor(T entry)
Description copied from interface: ObjectTableModel
locates the row where the given entry can be found in this model

Specified by:
getRowFor in interface ObjectTableModel<T>
Returns:
the row where the entry is found in the model or -1 if the entry doesn't exist in this model

setRowValues

public void setRowValues(Iterable<? extends T> updatedList)
                  throws UnsupportedOperationException
Description copied from interface: ObjectTableModel
allows to change the underlying table data based on the given collection. Unless specified otherwise, the given collection remains untouched and the elements are copied into the internal data structure of the model.

Specified by:
setRowValues in interface ObjectTableModel<T>
Throws:
UnsupportedOperationException - if this model doesn't allow such changes

unwrap

public ObjectTableModel<T> unwrap()
Description copied from interface: Wrapped
returns the embedded instance that this wrapper encloses

Specified by:
unwrap in interface Wrapped<TableModel>
Overrides:
unwrap in class TableModelWrapper


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads