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)
      Description copied from interface: IMiniTable
      Is column editable
      Specified by:
      isCellEditable in interface IMiniTable
      Returns:
      true if column is editable
    • getValueAt

      public Object getValueAt(int row, int column)
      Description copied from interface: IMiniTable
      Get value at row and 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)
      Description copied from interface: IMiniTable
      Convert view column index to model index
      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 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 from result set
      Specified by:
      loadTable in interface IMiniTable
    • loadTable

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

      public <T extends Serializable> T getSelectedRowKey()
      Description copied from interface: IMiniTable
      Get row key of selected row
      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()
      Description copied from interface: IMiniTable
      Get selected row index
      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 column layout
      Specified by:
      getLayoutInfo in interface IMiniTable
      Returns:
      array of ColumnInfo
    • getColumnCount

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

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

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

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

      public int getColorCode(int row)
      Description copied from interface: IMiniTable
      Get color code of row
      Specified by:
      getColorCode in interface IMiniTable
      Returns:
      color code
    • setColorCompare

      public void setColorCompare(Object dataCompare)
      Description copied from interface: IMiniTable
      Set comparison object for determination of row color code
      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 -