Class MiniTableImpl

java.lang.Object
org.compiere.minigrid.MiniTableImpl
All Implemented Interfaces:
IMiniTable

public class MiniTableImpl extends Object implements IMiniTable
Headless implementation of IMiniTable.
This support the use/test of some UI API (for e.g Match in headless environment (for e.g unit test).
Author:
hengsin
  • Constructor Details

    • MiniTableImpl

      public MiniTableImpl()
    • MiniTableImpl

      public MiniTableImpl(ColumnInfo[] layout)
      Parameters:
      layout -
  • Method Details

    • isCellEditable

      public boolean isCellEditable(int row, int column)
      Specified by:
      isCellEditable in interface IMiniTable
      Returns:
      true if column is editable
    • getValueAt

      public Object getValueAt(int row, int column)
      Specified by:
      getValueAt in interface IMiniTable
      Returns:
      value at row and column
    • setValueAt

      public void setValueAt(Object value, int row, int column)
      Description copied from interface: IMiniTable
      set value at row and column
      Specified by:
      setValueAt in interface IMiniTable
    • convertColumnIndexToModel

      public int convertColumnIndexToModel(int viewColumnIndex)
      Specified by:
      convertColumnIndexToModel in interface IMiniTable
      Returns:
      corresponding index at underlying model
    • setColumnReadOnly

      public void setColumnReadOnly(int index, boolean readOnly)
      Description copied from interface: IMiniTable
      change readonly attribute of a column
      Specified by:
      setColumnReadOnly in interface IMiniTable
    • prepareTable

      public String prepareTable(ColumnInfo[] layout, String from, String where, boolean multiSelection, String tableName)
      Description copied from interface: IMiniTable
      Prepare Table and return SQL required to get resultset to populate table
      Specified by:
      prepareTable in interface IMiniTable
      Returns:
      sql
    • addColumn

      public void addColumn(String header)
      Description copied from interface: IMiniTable
      add column with header
      Specified by:
      addColumn in interface IMiniTable
    • setColumnClass

      public void setColumnClass(int index, Class<?> classType, boolean readOnly, String header)
      Description copied from interface: IMiniTable
      set column class type
      Specified by:
      setColumnClass in interface IMiniTable
    • setColumnClass

      public void setColumnClass(int index, Class<?> classType, boolean readOnly)
      Description copied from interface: IMiniTable
      set column class type
      Specified by:
      setColumnClass in interface IMiniTable
    • loadTable

      public void loadTable(ResultSet rs)
      Description copied from interface: IMiniTable
      populate table
      Specified by:
      loadTable in interface IMiniTable
    • loadTable

      public void loadTable(PO[] pos)
      Description copied from interface: IMiniTable
      populate table
      Specified by:
      loadTable in interface IMiniTable
    • getSelectedRowKey

      public <T extends Serializable> T getSelectedRowKey()
      Specified by:
      getSelectedRowKey in interface IMiniTable
      Returns:
      row key
    • getRowKeyAt

      public <T extends Serializable> T getRowKeyAt(int index)
      get key of record at index
      Parameters:
      index -
      Returns:
    • getSelectedRow

      public int getSelectedRow()
      Specified by:
      getSelectedRow in interface IMiniTable
      Returns:
      selected row index or -1 if no selected row
    • setSelectedRow

      public void setSelectedRow(int selected)
    • setRowCount

      public void setRowCount(int rowCount)
      Description copied from interface: IMiniTable
      ensure table has >= rowCount rows. i.e to grow a table by 1 row, call table.setRowCount(table.getRowCount()+1)
      Specified by:
      setRowCount in interface IMiniTable
    • getLayoutInfo

      public ColumnInfo[] getLayoutInfo()
      Description copied from interface: IMiniTable
      get table layout
      Specified by:
      getLayoutInfo in interface IMiniTable
      Returns:
      array of ColumnInfo
    • getColumnCount

      public int getColumnCount()
      Specified by:
      getColumnCount in interface IMiniTable
      Returns:
      number of columns
    • getRowCount

      public int getRowCount()
      Specified by:
      getRowCount in interface IMiniTable
      Returns:
      number of rows
    • setMultiSelection

      public void setMultiSelection(boolean multiSelection)
      Description copied from interface: IMiniTable
      change multi selection attribute of table
      Specified by:
      setMultiSelection in interface IMiniTable
    • isMultiSelection

      public boolean isMultiSelection()
      Specified by:
      isMultiSelection in interface IMiniTable
      Returns:
      true if multi selection is turn on
    • getColorCode

      public int getColorCode(int row)
      Specified by:
      getColorCode in interface IMiniTable
      Returns:
      color code
    • setColorCompare

      public void setColorCompare(Object dataCompare)
      Specified by:
      setColorCompare in interface IMiniTable
    • repaint

      public void repaint()
      Description copied from interface: IMiniTable
      redraw the whole table
      Specified by:
      repaint in interface IMiniTable
    • autoSize

      public void autoSize()
      Description copied from interface: IMiniTable
      auto size column width
      Specified by:
      autoSize in interface IMiniTable
    • setShowTotals

      public void setShowTotals(boolean show)
      Description copied from interface: IMiniTable
      change show total attribute of table
      Specified by:
      setShowTotals in interface IMiniTable
    • addColumn

      public void addColumn(String header, String description, int AD_Reference_ID, Class<?> colClass)
      Add Table Column and specify the column header.
      Parameters:
      header - name of column header
      description -
      colClass -