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 Summary
Fields Modifier and Type Field Description protected MutableColumnModelcolumnComponentModelThe column component model.protected MutableListModellistComponentModelThe list component model.protected java.util.UUIDuidunique 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.-
Fields inherited from class de.hybris.platform.cockpit.model.listview.impl.AbstractTableModel
listeners
-
-
Constructor Summary
Constructors Constructor Description DefaultTableModel(MutableListModel listComponentModel, MutableColumnModel columnComponentModel)Instantiates a new default table model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckUserEditPermission(int colIndex, int rowIndex)Check user edit permission.UIEditorgetCellEditor(int columnIndex, int rowIndex)Returns the editor associated with the cell at position (colIndex,rowIndex).CellRenderergetCellRenderer(int columnIndex)MutableColumnModelgetColumnComponentModel()Returns this table model's column model.MutableListModelgetListComponentModel()Returns this table model's list model.CellRenderergetNewInlineItemRenderer(int columnIndex)Gets the new inline item renderer.java.lang.ObjectgetValueAt(int colIndex, int rowIndex)Returns the value of the cell at position (colIndex,rowIndex).booleanisCellEditable(int colIndex, int rowIndex)Returns whether the cell at position (colIndex,rowIndex) can be edited or not.booleanisCellSelectable(int colIndex, int rowIndex)Returns whether the cell at position (colIndex,rowIndex) can be selected or not.booleanisCellSelected(int colIndex, int rowIndex)Returns whether the cell at position (colIndex,rowIndex) is selected or not.voidsetColumnComponentModel(MutableColumnModel columnModel)Sets the column component model.voidsetListComponentModel(MutableListModel listModel)Sets the list component model.voidsetSelectedCell(int colIndex, int rowIndex)Sets the selected cell.voidsetSelectedCells(java.util.List<java.lang.Integer> colIndexes, java.util.List<java.lang.Integer> rowIndexes)Sets the selected cells.voidsetValueAt(int colIndex, int rowIndex, java.lang.Object data)Sets the value at.voidupdateDynamicColumns()Update dynamic columns.-
Methods inherited from class de.hybris.platform.cockpit.model.listview.impl.AbstractTableModel
addTableModelListener, fireCellChanged, fireEvent, fireSelectionChanged, getUIAccessRightService, removeTableModelListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.cockpit.model.listview.TableModel
addTableModelListener, fireEvent, removeTableModelListener
-
-
-
-
Field Detail
-
listComponentModel
protected MutableListModel listComponentModel
The list component model.
-
columnComponentModel
protected MutableColumnModel columnComponentModel
The column component model.
-
uid
protected java.util.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 Detail
-
DefaultTableModel
public DefaultTableModel(MutableListModel listComponentModel, MutableColumnModel columnComponentModel)
Instantiates a new default table model.- Parameters:
listComponentModel- the list component modelcolumnComponentModel- the column component model
-
-
Method Detail
-
setValueAt
public void setValueAt(int colIndex, int rowIndex, java.lang.Object data) throws ValueHandlerExceptionDescription copied from interface:MutableTableModelSets the value at.- Specified by:
setValueAtin interfaceMutableTableModel- Parameters:
colIndex- the col indexrowIndex- the row indexdata- the data- Throws:
ValueHandlerException- the value handler exception
-
setSelectedCell
public void setSelectedCell(int colIndex, int rowIndex)Description copied from interface:MutableTableModelSets the selected cell.- Specified by:
setSelectedCellin interfaceMutableTableModel- Parameters:
colIndex- the col indexrowIndex- the row index
-
setSelectedCells
public void setSelectedCells(java.util.List<java.lang.Integer> colIndexes, java.util.List<java.lang.Integer> rowIndexes)Description copied from interface:MutableTableModelSets the selected cells.- Specified by:
setSelectedCellsin interfaceMutableTableModel- Parameters:
colIndexes- the col indexesrowIndexes- the row indexes
-
getCellEditor
public UIEditor getCellEditor(int columnIndex, int rowIndex)
Description copied from interface:TableModelReturns the editor associated with the cell at position (colIndex,rowIndex).- Specified by:
getCellEditorin interfaceTableModel- Parameters:
columnIndex- zero based column position indexrowIndex- zero based row position index- Returns:
- the cell's editor
- See Also:
UIEditor
-
getColumnComponentModel
public MutableColumnModel getColumnComponentModel()
Description copied from interface:TableModelReturns this table model's column model.- Specified by:
getColumnComponentModelin interfaceMutableTableModel- Specified by:
getColumnComponentModelin interfaceTableModel- Returns:
- the column model of this table model
- See Also:
ColumnModel
-
getListComponentModel
public MutableListModel getListComponentModel()
Description copied from interface:TableModelReturns this table model's list model.- Specified by:
getListComponentModelin interfaceMutableTableModel- Specified by:
getListComponentModelin interfaceTableModel- Returns:
- the list model of this table model
- See Also:
ListComponentModel
-
getValueAt
public java.lang.Object getValueAt(int colIndex, int rowIndex)Description copied from interface:TableModelReturns the value of the cell at position (colIndex,rowIndex).- Specified by:
getValueAtin interfaceTableModel- Parameters:
colIndex- zero based column position indexrowIndex- 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 indexrowIndex- the row index- Returns:
- true, if successful
-
isCellEditable
public boolean isCellEditable(int colIndex, int rowIndex)Description copied from interface:TableModelReturns whether the cell at position (colIndex,rowIndex) can be edited or not.- Specified by:
isCellEditablein interfaceTableModel- Parameters:
colIndex- zero based column position indexrowIndex- zero based row position index- Returns:
trueif a cell exists at the specified position and is editable,falseotherwise
-
isCellSelectable
public boolean isCellSelectable(int colIndex, int rowIndex)Description copied from interface:TableModelReturns whether the cell at position (colIndex,rowIndex) can be selected or not.- Specified by:
isCellSelectablein interfaceTableModel- Parameters:
colIndex- zero based column position indexrowIndex- zero based row position index- Returns:
trueif a cell exists at the specified position and is selectable,falseotherwise
-
isCellSelected
public boolean isCellSelected(int colIndex, int rowIndex)Description copied from interface:TableModelReturns whether the cell at position (colIndex,rowIndex) is selected or not.- Specified by:
isCellSelectedin interfaceTableModel- Parameters:
colIndex- zero based column position indexrowIndex- zero based row position index- Returns:
trueif a cell exists at the specified position and is selected,falseotherwise
-
getCellRenderer
public CellRenderer getCellRenderer(int columnIndex)
- Specified by:
getCellRendererin interfaceTableModel
-
getNewInlineItemRenderer
public CellRenderer getNewInlineItemRenderer(int columnIndex)
Description copied from interface:TableModelGets the new inline item renderer.- Specified by:
getNewInlineItemRendererin interfaceTableModel- Parameters:
columnIndex- the column index- Returns:
- the new inline item render
-
setListComponentModel
public void setListComponentModel(MutableListModel listModel)
Description copied from interface:MutableTableModelSets the list component model.- Specified by:
setListComponentModelin interfaceMutableTableModel- Parameters:
listModel- the new list component model
-
setColumnComponentModel
public void setColumnComponentModel(MutableColumnModel columnModel)
Description copied from interface:MutableTableModelSets the column component model.- Specified by:
setColumnComponentModelin interfaceMutableTableModel- Parameters:
columnModel- the new column component model
-
updateDynamicColumns
public void updateDynamicColumns()
Description copied from interface:MutableTableModelUpdate dynamic columns.- Specified by:
updateDynamicColumnsin interfaceMutableTableModel
-
-