Holger's
Java API

com.antelmann.util.table
Class RowNumberTableModel

java.lang.Object
  extended by com.antelmann.util.table.RowNumberTableModel
All Implemented Interfaces:
Wrapped<TableModel>, TableModel

public class RowNumberTableModel
extends Object
implements TableModel, Wrapped<TableModel>

wraps a given TableModel and adds a first column that simply contains a row numbering

Since:
03.11.2009, 03:03:02
Author:
Holger Antelmann

Field Summary
protected  String rowTitle
           
 
Constructor Summary
RowNumberTableModel(TableModel model)
           
 
Method Summary
 void addTableModelListener(TableModelListener listener)
           
 Class<?> getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int columnIndex)
           
 int getRowCount()
           
protected  Object getRowNumber(int row)
          allows to customize the numbering through overriding
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void removeTableModelListener(TableModelListener l)
           
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 TableModel unwrap()
          returns the embedded instance that this wrapper encloses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rowTitle

protected String rowTitle
Constructor Detail

RowNumberTableModel

public RowNumberTableModel(TableModel model)
Method Detail

unwrap

public TableModel unwrap()
Description copied from interface: Wrapped
returns the embedded instance that this wrapper encloses

Specified by:
unwrap in interface Wrapped<TableModel>

addTableModelListener

@Warning(value="the column in a change event is not translated")
public void addTableModelListener(TableModelListener listener)
Specified by:
addTableModelListener in interface TableModel

getColumnClass

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

getColumnCount

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

getColumnName

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

getRowCount

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

getRowNumber

protected Object getRowNumber(int row)
allows to customize the numbering through overriding


getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel

removeTableModelListener

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

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel


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