|
Adempiere 3.5.2a | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Listbox
org.adempiere.webui.component.Listbox
org.adempiere.webui.component.WListbox
public class WListbox
Replacement for the Swing client minigrid component ZK Listbox extension for Adempiere Web UI. The listbox contains a model and a renderer. The model holds the underlying data objects, while the renderer deals with displaying the data objects. The renderer will render data objects using a variety of components. These components can then be edited if they are not readonly.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zul.Listbox |
|---|
Listbox.ExtraCtrl |
| Field Summary | |
|---|---|
protected int |
m_keyColumnIndex
Model Index of Key Column. |
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
WListbox()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addColumn(Class classType,
boolean readOnly,
String header)
Set the attributes of the column. |
void |
addColumn(String header)
Add Table Column and specify the column header. |
void |
clear()
Clear the table components. |
void |
clearTable()
Removes all data stored in the underlying model. |
int |
convertColumnIndexToModel(int viewColumnIndex)
Convert the index for a column from the display index to the corresponding index in the underlying model. |
int |
getColorCode(int row)
Get ColorCode for Row. |
ColumnInfo[] |
getLayout()
Get the table layout. |
ColumnInfo[] |
getLayoutInfo()
Get Layout. |
ListModelTable |
getModel()
Return the ListModelTable associated with this table. |
int |
getRowCount()
Get the number of rows in this table's model. |
int |
getSelectedRow()
Returns the index of the first selected row, -1 if no row is selected. |
Integer |
getSelectedRowKey()
Get the key of currently selected row based on layout defined in prepareTable(ColumnInfo[], String, String, boolean, String). |
Object |
getValueAt(int row,
int column)
Returns the cell value at row and column. |
boolean |
isCellEditable(int row,
int column)
Is the cell at the specified row and column editable? |
boolean |
isMultiSelection()
Query whether multiple rows can be selected in the table. |
void |
loadTable(PO[] pos)
Load Table from Object Array. |
void |
loadTable(ResultSet rs)
Load Table from ResultSet - The ResultSet is not closed. |
String |
prepareTable(ColumnInfo[] layout,
String from,
String where,
boolean multiSelection,
String tableName)
Prepare Table and return SQL required to get resultset to populate table. |
String |
prepareTable(ColumnInfo[] layout,
String from,
String where,
boolean multiSelection,
String tableName,
boolean addAccessSQL)
Prepare Table and return SQL required to get resultset to populate table |
void |
repaint()
Repaint the Table. |
void |
setColorColumn(int modelIndex)
Set the Column to determine the color of the row (based on model index). |
void |
setColorCompare(Object dataCompare)
Set ColorColumn comparison criteria. |
void |
setColumnClass(int index,
Class classType,
boolean readOnly)
Set the attributes of the column. |
void |
setColumnClass(int index,
Class classType,
boolean readOnly,
String header)
Set the attributes of the column. |
void |
setColumnReadOnly(int index,
boolean readOnly)
Set Column at the specified index to read-only or read/write. |
void |
setData(ListModelTable model,
Vector<? extends String> columnNames)
Set the data model and column header names for the Listbox. |
void |
setModel(ListModel model)
|
void |
setMultiSelection(boolean multiSelection)
Set whether or not multiple rows can be selected. |
void |
setRowCount(int rowCount)
Set the size of the underlying data model. |
void |
setValueAt(Object value,
int row,
int column)
Set the cell value at row and column. |
void |
tableChanged(WTableModelEvent event)
Respond to a change in the table's model. |
void |
tableValueChange(TableValueChangeEvent event)
Respond to a TableValueChangeEvent event Notifies this listener that an event has occurred. |
| Methods inherited from class org.adempiere.webui.component.Listbox |
|---|
addDoubleClickListener, addOnDropListener, addPropertyChangeListener, appendItem, appendItem, getItemAtIndex, getItems, getListHead, getSelectedIndices, getSelectedItem, insertBefore, isEnabled, isItemDraggable, onEvent, setEnabled, setItemDraggable, setSelectedIndices, setValue |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int m_keyColumnIndex
| Constructor Detail |
|---|
public WListbox()
| Method Detail |
|---|
public void setData(ListModelTable model,
Vector<? extends String> columnNames)
model - The data model to assign to the tablecolumnNames - The names of the table columnspublic void setModel(ListModel model)
setModel in class Listbox
public boolean isCellEditable(int row,
int column)
row - row index of cellcolumn - column index of cell
public Object getValueAt(int row,
int column)
row and column.
Note: The column is specified in the table view's display
order, and not in the TableModel's column
order. This is an important distinction because as the
user rearranges the columns in the table,
the column at a given index in the view will change.
Meanwhile the user's actions never affect the model's
column ordering.
row - the index of the row whose value is to be queriedcolumn - the index of the column whose value is to be queried
public ListModelTable getModel()
ListModelTable associated with this table.
getModel in class ListboxListModelTable associated with this table.
public void setValueAt(Object value,
int row,
int column)
row and column.
value - The value to setrow - the index of the row whose value is to be setcolumn - the index of the column whose value is to be setpublic int convertColumnIndexToModel(int viewColumnIndex)
This is unused for this implementation because the column ordering cannot be dynamically changed.
viewColumnIndex - the index of the column in the view
#convertColumnIndexToVi
public void setColumnReadOnly(int index,
boolean readOnly)
index to read-only or read/write.
index - index of column to set as read-only (or not)readOnly - Read only value. If true column is read only,
if false column is read-write
public String prepareTable(ColumnInfo[] layout,
String from,
String where,
boolean multiSelection,
String tableName)
layout - array of column infofrom - SQL FROM contentwhere - SQL WHERE contentmultiSelection - multiple selectionstableName - table name
public String prepareTable(ColumnInfo[] layout,
String from,
String where,
boolean multiSelection,
String tableName,
boolean addAccessSQL)
layout - array of column infofrom - SQL FROM contentwhere - SQL WHERE contentmultiSelection - multiple selectionstableName - multiple selectionsaddAccessSQL - specifies whether to addAcessSQL
public void addColumn(String header)
header - name of column header
public void setColumnClass(int index,
Class classType,
boolean readOnly,
String header)
index - The index of the column to be modifiedclassType - The class of data that the column will containreadOnly - Whether the data in the column is read onlyheader - The header text for the columnsetColumnClass(int, Class, boolean)
public void setColumnClass(int index,
Class classType,
boolean readOnly)
index - The index of the column to be modifiedclassType - The class of data that the column will containreadOnly - Whether the data in the column is read onlysetColumnClass(int, Class, boolean, String)
public void addColumn(Class classType,
boolean readOnly,
String header)
classType - The class of data that the column will containreadOnly - Whether the data in the column is read onlyheader - The header text for the columnsetColumnClass(int, Class, boolean),
addColumn(String)public void setColorColumn(int modelIndex)
modelIndex - the index of the column used to decide the colourpublic void loadTable(ResultSet rs)
rs - ResultSet containing data t enter int the table.
The contents must conform to the column layout defined in
prepareTable(ColumnInfo[], String, String, boolean, String)public void loadTable(PO[] pos)
pos - array of Persistent Objectspublic void clear()
public Integer getSelectedRowKey()
prepareTable(ColumnInfo[], String, String, boolean, String).
public int getSelectedRow()
public void setRowCount(int rowCount)
rowCount - number of rowspublic ColumnInfo[] getLayoutInfo()
public void clearTable()
public int getRowCount()
public void setMultiSelection(boolean multiSelection)
multiSelection - are multiple selections allowedpublic boolean isMultiSelection()
public void setColorCompare(Object dataCompare)
dataCompare - object encapsualating comparison criteriapublic int getColorCode(int row)
If numerical value in compare column is
negative = -1,
positive = 1,
otherwise = 0
If Timestamp
row - row
public void tableValueChange(TableValueChangeEvent event)
TableValueChangeListenerWListItemRenderer.addTableValueChangeListener(TableValueChangeListener)
tableValueChange in interface TableValueChangeListenerevent - The event that has occurredpublic void repaint()
public ColumnInfo[] getLayout()
setLayout(ColumnInfo[])public void tableChanged(WTableModelEvent event)
tableChanged in interface WTableModelListenerevent - The event fired to indicate a change in the table's model
|
Adempiere 3.5.2a | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||