Class TableModelBean

java.lang.Object
org.openxava.tab.impl.TableModelBean
All Implemented Interfaces:
Serializable, TableModel, IObjectTableModel, IRefreshTableModel, IXTableModel

public class TableModelBean extends Object implements IXTableModel, Serializable
IXTableModel implementation in JavaBean format.

It's a read only TableModel.
Call to invariant() before use.

Author:
Javier Paniza
See Also:
  • Constructor Details

    • TableModelBean

      public TableModelBean()
  • Method Details

    • addTableModelListener

      public void addTableModelListener(TableModelListener l)
      Specified by:
      addTableModelListener in interface TableModel
    • getHeading

      public String[] getHeading()
    • getColumnsClasses

      public String[] getColumnsClasses()
    • 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
    • getEntityTab

      public IEntityTabImpl getEntityTab()
    • getPKIndexes

      public int[] getPKIndexes()
      Indexes of columns that contains the primary key.
      Primary key is used for create the object associated to row.
    • getObjectAt

      public Object getObjectAt(int rowIndex) throws javax.ejb.FinderException
      Description copied from interface: IObjectTableModel
      Return the object associated to indicated row.
      Specified by:
      getObjectAt in interface IObjectTableModel
      Specified by:
      getObjectAt in interface IXTableModel
      Throws:
      javax.ejb.FinderException
    • getRowCount

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

      public Object getValueAt(int rowIndex, int columnIndex) throws NoSuchElementException
      Specified by:
      getValueAt in interface TableModel
      Throws:
      NoSuchElementException
    • invariant

      public void invariant() throws IllegalStateException
      Verify object invariant.
      Invariant:
      • headers != null
      • entityTab != null
      • indexesPK != null
      Throws:
      IllegalStateException - If invariant is broken
    • isCellEditable

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

      public void refresh()
      Description copied from interface: IRefreshTableModel
      Refresh data from datasource.
      Specified by:
      refresh in interface IRefreshTableModel
      Specified by:
      refresh in interface IXTableModel
    • removeAllRows

      public void removeAllRows()
      Specified by:
      removeAllRows in interface IXTableModel
    • removeTableModelListener

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

      public void setHeading(String[] heading)
    • setColumnsClasses

      public void setColumnsClasses(String[] columnsClasses)
    • setEntityTab

      public void setEntityTab(IEntityTabImpl entityTab)
    • setPKIndexes

      public void setPKIndexes(int[] indicesPK)
      Indexes of columns that contains the primary key.
      Primary key is used for create the object associated to row.
    • setValueAt

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

      public String toString()
      Return TablaModelBean> Rows: x, Columns: x.
      Overrides:
      toString in class Object
    • getTotalSize

      public int getTotalSize() throws RemoteException
      Description copied from interface: IXTableModel
      Total count of objects represented by this table model.

      Cantidad de objetos total representados por el table model.

      getRowCount() in another side, return the loaded objects count, not total.

      Specified by:
      getTotalSize in interface IXTableModel
      Throws:
      RemoteException
    • getSum

      public Number getSum(String property) throws RemoteException
      Specified by:
      getSum in interface IXTableModel
      Throws:
      RemoteException
    • isTranslateHeading

      public boolean isTranslateHeading()
      If true tries to translate the heading.

      If a dot is found in heading label assume resourceFile.nombreId.
      For example, if the label is MyAplicationResources.plazo then find in MyAplicationResources resource bundle the identifier plazo.
      If no dot the take the label as is.
      Of course, if this properti is false do nothing.
      By default is true

    • setTranslateHeading

      public void setTranslateHeading(boolean b)
    • setPropertiesNames

      public void setPropertiesNames(List propertiesNames)
    • getPropertiesNames

      public List getPropertiesNames()
    • removeRow

      public void removeRow(Map keyValues) throws javax.ejb.FinderException
      Specified by:
      removeRow in interface IXTableModel
      Throws:
      javax.ejb.FinderException
    • getChunkSize

      public int getChunkSize()
      Specified by:
      getChunkSize in interface IXTableModel
      Since:
      5.7
    • isAllLoaded

      public boolean isAllLoaded()
      Specified by:
      isAllLoaded in interface IXTableModel
      Since:
      5.7