FileDocCategorySizeDatePackage
AbstractFilterModel.javaAPI DocExample3370Mon Jul 23 13:26:34 BST 2007org.apache.struts2.components.table

AbstractFilterModel

public abstract class AbstractFilterModel extends AbstractTableModel

Fields Summary
protected TableModel
model
Constructors Summary
public AbstractFilterModel(TableModel tm)

        model = tm;
    
Methods Summary
public voidaddRow(java.util.Vector data)

        if (model instanceof DefaultTableModel) {
            ((DefaultTableModel) model).addRow(data);
        } else if (model instanceof AbstractFilterModel) {
            ((AbstractFilterModel) model).addRow(data);
        } else {
            throw (new IllegalStateException("Error attempting to add a row to an underlying model that is not a DefaultTableModel."));
        }
    
public java.lang.ClassgetColumnClass(int par1)

        return model.getColumnClass(par1);
    
public intgetColumnCount()

        return model.getColumnCount();
    
public java.lang.StringgetColumnName(int par1)

        return model.getColumnName(par1);
    
public javax.swing.table.TableModelgetModel()

        return model;
    
public intgetRowCount()

        return model.getRowCount();
    
public java.lang.ObjectgetValueAt(int par1, int par2)

        return model.getValueAt(par1, par2);
    
public booleanisCellEditable(int par1, int par2)

        return model.isCellEditable(par1, par2);
    
public voidremoveAllRows()

        while (this.getRowCount() > 0) {
            this.removeRow(0);
        }
    
public voidremoveRow(int rowNum)

        if (model instanceof DefaultTableModel) {
            ((DefaultTableModel) model).removeRow(rowNum);
        } else if (model instanceof AbstractFilterModel) {
            ((AbstractFilterModel) model).removeRow(rowNum);
        } else {
            throw (new IllegalStateException("Error attempting to remove a row from an underlying model that is not a DefaultTableModel."));
        }
    
public voidsetModel(javax.swing.table.TableModel model)

        this.model = model;
        this.fireTableDataChanged();
    
public voidsetValueAt(java.lang.Object par1, int par2, int par3)

        model.setValueAt(par1, par2, par3);