Class DefaultTableModel

java.lang.Object
de.hybris.platform.cockpit.model.listview.impl.AbstractTableModel
de.hybris.platform.cockpit.model.listview.impl.DefaultTableModel
All Implemented Interfaces:
MutableTableModel, TableModel
Direct Known Subclasses:
ContextAreaTableModel, SectionTableModel, TaskTableModel

public class DefaultTableModel extends AbstractTableModel implements MutableTableModel
The Class DefaultTableModel.
  • Field Details

    • listComponentModel

      protected MutableListModel listComponentModel
      The list component model.
    • columnComponentModel

      protected MutableColumnModel columnComponentModel
      The column component model.
    • uid

      protected UUID uid
      unique id related with this DefaultTableModel, it is used to generate key which we use to put and get values from cache:TABLE_VALUE_REQUEST_CACHE (i.e. when user has 2 tables on a screen we need to distinguish them)
  • Constructor Details

    • DefaultTableModel

      public DefaultTableModel(MutableListModel listComponentModel, MutableColumnModel columnComponentModel)
      Instantiates a new default table model.
      Parameters:
      listComponentModel - the list component model
      columnComponentModel - the column component model
  • Method Details

    • setValueAt

      public void setValueAt(int colIndex, int rowIndex, Object data) throws ValueHandlerException
      Description copied from interface: MutableTableModel
      Sets the value at.
      Specified by:
      setValueAt in interface MutableTableModel
      Parameters:
      colIndex - the col index
      rowIndex - the row index
      data - the data
      Throws:
      ValueHandlerException - the value handler exception
    • setSelectedCell

      public void setSelectedCell(int colIndex, int rowIndex)
      Description copied from interface: MutableTableModel
      Sets the selected cell.
      Specified by:
      setSelectedCell in interface MutableTableModel
      Parameters:
      colIndex - the col index
      rowIndex - the row index
    • setSelectedCells

      public void setSelectedCells(List<Integer> colIndexes, List<Integer> rowIndexes)
      Description copied from interface: MutableTableModel
      Sets the selected cells.
      Specified by:
      setSelectedCells in interface MutableTableModel
      Parameters:
      colIndexes - the col indexes
      rowIndexes - the row indexes
    • getCellEditor

      public UIEditor getCellEditor(int columnIndex, int rowIndex)
      Description copied from interface: TableModel
      Returns the editor associated with the cell at position (colIndex, rowIndex).
      Specified by:
      getCellEditor in interface TableModel
      Parameters:
      columnIndex - zero based column position index
      rowIndex - zero based row position index
      Returns:
      the cell's editor
      See Also:
    • getColumnComponentModel

      public MutableColumnModel getColumnComponentModel()
      Description copied from interface: TableModel
      Returns this table model's column model.
      Specified by:
      getColumnComponentModel in interface MutableTableModel
      Specified by:
      getColumnComponentModel in interface TableModel
      Returns:
      the column model of this table model
      See Also:
    • getListComponentModel

      public MutableListModel getListComponentModel()
      Description copied from interface: TableModel
      Returns this table model's list model.
      Specified by:
      getListComponentModel in interface MutableTableModel
      Specified by:
      getListComponentModel in interface TableModel
      Returns:
      the list model of this table model
      See Also:
    • getValueAt

      public Object getValueAt(int colIndex, int rowIndex)
      Description copied from interface: TableModel
      Returns the value of the cell at position (colIndex, rowIndex).
      Specified by:
      getValueAt in interface TableModel
      Parameters:
      colIndex - zero based column position index
      rowIndex - zero based row position index
      Returns:
      the cell's value
    • checkUserEditPermission

      protected boolean checkUserEditPermission(int colIndex, int rowIndex)
      Check user edit permission.
      Parameters:
      colIndex - the col index
      rowIndex - the row index
      Returns:
      true, if successful
    • isCellEditable

      public boolean isCellEditable(int colIndex, int rowIndex)
      Description copied from interface: TableModel
      Returns whether the cell at position (colIndex, rowIndex) can be edited or not.
      Specified by:
      isCellEditable in interface TableModel
      Parameters:
      colIndex - zero based column position index
      rowIndex - zero based row position index
      Returns:
      true if a cell exists at the specified position and is editable, false otherwise
    • isCellSelectable

      public boolean isCellSelectable(int colIndex, int rowIndex)
      Description copied from interface: TableModel
      Returns whether the cell at position (colIndex, rowIndex) can be selected or not.
      Specified by:
      isCellSelectable in interface TableModel
      Parameters:
      colIndex - zero based column position index
      rowIndex - zero based row position index
      Returns:
      true if a cell exists at the specified position and is selectable, false otherwise
    • isCellSelected

      public boolean isCellSelected(int colIndex, int rowIndex)
      Description copied from interface: TableModel
      Returns whether the cell at position (colIndex, rowIndex) is selected or not.
      Specified by:
      isCellSelected in interface TableModel
      Parameters:
      colIndex - zero based column position index
      rowIndex - zero based row position index
      Returns:
      true if a cell exists at the specified position and is selected, false otherwise
    • getCellRenderer

      public CellRenderer getCellRenderer(int columnIndex)
      Specified by:
      getCellRenderer in interface TableModel
    • getNewInlineItemRenderer

      public CellRenderer getNewInlineItemRenderer(int columnIndex)
      Description copied from interface: TableModel
      Gets the new inline item renderer.
      Specified by:
      getNewInlineItemRenderer in interface TableModel
      Parameters:
      columnIndex - the column index
      Returns:
      the new inline item render
    • setListComponentModel

      public void setListComponentModel(MutableListModel listModel)
      Description copied from interface: MutableTableModel
      Sets the list component model.
      Specified by:
      setListComponentModel in interface MutableTableModel
      Parameters:
      listModel - the new list component model
    • setColumnComponentModel

      public void setColumnComponentModel(MutableColumnModel columnModel)
      Description copied from interface: MutableTableModel
      Sets the column component model.
      Specified by:
      setColumnComponentModel in interface MutableTableModel
      Parameters:
      columnModel - the new column component model
    • updateDynamicColumns

      public void updateDynamicColumns()
      Description copied from interface: MutableTableModel
      Update dynamic columns.
      Specified by:
      updateDynamicColumns in interface MutableTableModel