Holger's
Java API

com.antelmann.util.table
Class TableModelView

java.lang.Object
  extended by com.antelmann.util.table.TableModelView
All Implemented Interfaces:
TableModel

public class TableModelView
extends Object
implements TableModel

provides a view of a given TableModel. Note that this implementation is not synchronized.

Author:
Holger Antelmann

Constructor Summary
TableModelView(TableModel model, int... visibleColumn)
           
 
Method Summary
 void addTableModelListener(TableModelListener listener)
           
 int findColumnInBackingModel(String columnName)
           
 TableModel getBackingModel()
           
 Class<?> getColumnClass(int column)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 int getRowCount()
           
 Object getValueAt(int row, int column)
           
 List<Integer> getVisibleColums()
           
 boolean isCellEditable(int row, int column)
           
 boolean isVisibleColumn(int c)
           
 boolean isVisibleColumn(String columnName)
           
 void removeTableModelListener(TableModelListener listener)
           
 void setColumnVisible(int column, boolean flag)
          Note: listeners to the model will ONLY be notified if the backing model is an instance of an AbstractTableModel, otherwise NOT!
 void setValueAt(Object value, int row, int column)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableModelView

public TableModelView(TableModel model,
                      int... visibleColumn)
               throws ArrayIndexOutOfBoundsException
Throws:
ArrayIndexOutOfBoundsException
Method Detail

getBackingModel

public TableModel getBackingModel()

findColumnInBackingModel

public int findColumnInBackingModel(String columnName)

isVisibleColumn

public boolean isVisibleColumn(String columnName)

getVisibleColums

public List<Integer> getVisibleColums()

isVisibleColumn

public boolean isVisibleColumn(int c)

setColumnVisible

public void setColumnVisible(int column,
                             boolean flag)
                      throws ArrayIndexOutOfBoundsException
Note: listeners to the model will ONLY be notified if the backing model is an instance of an AbstractTableModel, otherwise NOT!

Throws:
ArrayIndexOutOfBoundsException

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel

getColumnClass

public Class<?> getColumnClass(int column)
Specified by:
getColumnClass in interface TableModel

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Specified by:
isCellEditable in interface TableModel

getValueAt

public Object getValueAt(int row,
                         int column)
Specified by:
getValueAt in interface TableModel

setValueAt

public void setValueAt(Object value,
                       int row,
                       int column)
Specified by:
setValueAt in interface TableModel

addTableModelListener

public void addTableModelListener(TableModelListener listener)
Specified by:
addTableModelListener in interface TableModel

removeTableModelListener

public void removeTableModelListener(TableModelListener listener)
Specified by:
removeTableModelListener in interface TableModel


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