Package org.compiere.minigrid
Interface IMiniTable
- All Known Implementing Classes:
MiniTableImpl
,WListbox
public interface IMiniTable
- Author:
- hengsin
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add column with headervoid
autoSize()
auto size column widthint
convertColumnIndexToModel
(int viewColumnIndex) int
getColorCode
(int row) int
get table layoutint
int
<T extends Serializable>
TgetValueAt
(int row, int column) boolean
isCellEditable
(int row, int column) boolean
void
populate tablevoid
populate tableprepareTable
(ColumnInfo[] layout, String from, String where, boolean multiSelection, String tableName) Prepare Table and return SQL required to get resultset to populate tablevoid
repaint()
redraw the whole tablevoid
setColorCompare
(Object dataCompare) void
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 multi selection attribute of tablevoid
setRowCount
(int rowCount) ensure table has >= rowCount rows.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) - Parameters:
row
-column
-- Returns:
- true if column is editable
-
getValueAt
- 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) - 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 required 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- Parameters:
rs
-
-
loadTable
populate table- Parameters:
pos
-
-
getSelectedRowKey
- Returns:
- row key
-
getSelectedRow
int getSelectedRow()- 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 layout- Returns:
- array of
ColumnInfo
-
getColumnCount
int getColumnCount()- Returns:
- number of columns
-
getRowCount
int getRowCount()- Returns:
- number of rows
-
setMultiSelection
void setMultiSelection(boolean multiSelection) change multi selection attribute of table- Parameters:
multiSelection
-
-
isMultiSelection
boolean isMultiSelection()- Returns:
- true if multi selection is turn on
-
getColorCode
int getColorCode(int row) - Parameters:
row
-- Returns:
- color code
-
setColorCompare
- 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
-
-