Package org.compiere.minigrid
Interface IMiniTable
- All Known Implementing Classes:
MiniTableImpl
,WListbox
public interface IMiniTable
UI Table interface
- Author:
- hengsin
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add column with headervoid
autoSize()
Auto size column widthint
convertColumnIndexToModel
(int viewColumnIndex) Convert view column index to model indexint
getColorCode
(int row) Get color code of rowint
Get number of columnsGet table column layoutint
Get number of rowsint
Get selected row index<T extends Serializable>
TGet row key of selected rowgetValueAt
(int row, int column) Get value at row and columnboolean
isCellEditable
(int row, int column) Is column editableboolean
Is multi selection turn onvoid
Populate table from result setvoid
Populate table from POsprepareTable
(ColumnInfo[] layout, String from, String where, boolean multiSelection, String tableName) Prepare Table and return SQL to get resultset to populate tablevoid
repaint()
Redraw the whole tablevoid
setColorCompare
(Object dataCompare) Set comparison object for determination of row color codevoid
setColumnClass
(int index, Class<?> classType, boolean readOnly) Set column class typevoid
setColumnClass
(int index, Class<?> classType, boolean readOnly, String header) Set column class typevoid
setColumnReadOnly
(int index, boolean readOnly) Change readonly attribute of a columnvoid
setMultiSelection
(boolean multiSelection) Change multiple selection attribute of tablevoid
setRowCount
(int rowCount) Ensure table has >= rowCount rows.
i.e to grow a table by 1 row, call table.setRowCount(table.getRowCount()+1)void
setShowTotals
(boolean show) Change show total attribute of tablevoid
setValueAt
(Object value, int row, int column) Set value at row and column
-
Method Details
-
isCellEditable
boolean isCellEditable(int row, int column) Is column editable- Parameters:
row
-column
-- Returns:
- true if column is editable
-
getValueAt
Get value at row and column- Parameters:
row
-column
-- Returns:
- value at row and column
-
setValueAt
Set value at row and column- Parameters:
value
-row
-column
-
-
convertColumnIndexToModel
int convertColumnIndexToModel(int viewColumnIndex) Convert view column index to model index- Parameters:
viewColumnIndex
-- Returns:
- corresponding index at underlying model
-
setColumnReadOnly
void setColumnReadOnly(int index, boolean readOnly) Change readonly attribute of a column- Parameters:
index
-readOnly
-
-
prepareTable
String prepareTable(ColumnInfo[] layout, String from, String where, boolean multiSelection, String tableName) Prepare Table and return SQL to get resultset to populate table- Parameters:
layout
-from
-where
-multiSelection
-tableName
-- Returns:
- sql
-
addColumn
add column with header- Parameters:
header
-
-
setColumnClass
Set column class type- Parameters:
index
-classType
-readOnly
-header
-
-
setColumnClass
Set column class type- Parameters:
index
-classType
-readOnly
-
-
loadTable
Populate table from result set- Parameters:
rs
-
-
loadTable
Populate table from POs- Parameters:
pos
-
-
getSelectedRowKey
Get row key of selected row- Returns:
- row key
-
getSelectedRow
int getSelectedRow()Get selected row index- Returns:
- selected row index or -1 if no selected row
-
setRowCount
void setRowCount(int rowCount) Ensure table has >= rowCount rows.
i.e to grow a table by 1 row, call table.setRowCount(table.getRowCount()+1)- Parameters:
rowCount
-
-
getLayoutInfo
ColumnInfo[] getLayoutInfo()Get table column layout- Returns:
- array of
ColumnInfo
-
getColumnCount
int getColumnCount()Get number of columns- Returns:
- number of columns
-
getRowCount
int getRowCount()Get number of rows- Returns:
- number of rows
-
setMultiSelection
void setMultiSelection(boolean multiSelection) Change multiple selection attribute of table- Parameters:
multiSelection
-
-
isMultiSelection
boolean isMultiSelection()Is multi selection turn on- Returns:
- true if multi selection is turn on
-
getColorCode
int getColorCode(int row) Get color code of row- Parameters:
row
-- Returns:
- color code
-
setColorCompare
Set comparison object for determination of row color code- Parameters:
dataCompare
-
-
repaint
void repaint()Redraw the whole table -
autoSize
void autoSize()Auto size column width -
setShowTotals
void setShowTotals(boolean show) Change show total attribute of table- Parameters:
show
-
-