Package org.adempiere.webui.adwindow
Class GridTableListModel
java.lang.Object
org.zkoss.zul.AbstractListModel<Object>
org.adempiere.webui.adwindow.GridTableListModel
- All Implemented Interfaces:
Serializable
,EventListener
,TableModelListener
,org.zkoss.zul.ext.Pageable
,org.zkoss.zul.ext.Selectable<Object>
,org.zkoss.zul.ext.Sortable<Object>
,org.zkoss.zul.ListModel<Object>
,org.zkoss.zul.PageableModel
public class GridTableListModel
extends org.zkoss.zul.AbstractListModel<Object>
implements TableModelListener, org.zkoss.zul.ext.Sortable<Object>
List model for
GridTable
- Author:
- Low Heng Sin
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zul.AbstractListModel
org.zkoss.zul.AbstractListModel.DefaultSelectionControl<E extends Object>
-
Field Summary
Fields inherited from class org.zkoss.zul.AbstractListModel
_selection
Fields inherited from interface org.zkoss.zul.PageableModel
INTERNAL_EVENT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetElementAt
(int rowIndex) int
getPage()
Get current page noint
Get number of rows per pageint
getSize()
Get total number of rowsgetSortDirection
(Comparator<Object> cmpr) void
setEditing
(boolean b) Set editing to true/false.
When editing is true, do not fire ListDataEvent.CONTENTS_CHANGED event.void
setPage
(int pg) Set current page no ( starting from 0 )void
setPageSize
(int pgSize) Set number of rows per pagevoid
sort
(Comparator<Object> cmpr, boolean ascending) Sort and fire ListDataEvent.CONTENTS_CHANGED event to notify UI component.void
Handle TableModelEvent from GridTable.void
updateComponent
(int row) Delegate toupdateComponent(int, int)
.void
updateComponent
(int fromRow, int toRow) Request components that attached to this model to re-render a range of row.
Fire ListDataEvent.CONTENTS_CHANGED event for fromRow to toRow.Methods inherited from class org.zkoss.zul.AbstractListModel
addListDataListener, addPagingEventListener, addToSelection, clearSelection, clone, fireEvent, fireSelectionEvent, getActivePage, getListDataListeners, getPageCount, getSelection, getSelectionControl, getTotalSize, isMultiple, isSelected, isSelectionEmpty, newEmptySelection, readSelection, removeAllSelection, removeFromSelection, removeListDataListener, removePagingEventListener, retainAllSelection, setActivePage, setMultiple, setSelection, setSelectionControl, writeSelection
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.zkoss.zul.ext.Sortable
sort
-
Constructor Details
-
GridTableListModel
- Parameters:
tableModel
-windowNo
-
-
-
Method Details
-
getElementAt
- Specified by:
getElementAt
in interfaceorg.zkoss.zul.ListModel<Object>
- Parameters:
rowIndex
-- See Also:
-
ListModel.getElementAt(int)
-
setPage
public void setPage(int pg) Set current page no ( starting from 0 )- Parameters:
pg
-
-
getPage
public int getPage()Get current page no- Returns:
- current page no ( starting from 0 )
-
setPageSize
public void setPageSize(int pgSize) Set number of rows per page- Specified by:
setPageSize
in interfaceorg.zkoss.zul.ext.Pageable
- Overrides:
setPageSize
in classorg.zkoss.zul.AbstractListModel<Object>
- Parameters:
pgSize
-
-
getPageSize
public int getPageSize()Get number of rows per page- Specified by:
getPageSize
in interfaceorg.zkoss.zul.ext.Pageable
- Overrides:
getPageSize
in classorg.zkoss.zul.AbstractListModel<Object>
- Returns:
- pageSize
-
getSize
public int getSize()Get total number of rows- Specified by:
getSize
in interfaceorg.zkoss.zul.ListModel<Object>
- Returns:
- int
- See Also:
-
ListModel.getSize()
-
updateComponent
public void updateComponent(int row) Delegate toupdateComponent(int, int)
.- Parameters:
row
-
-
updateComponent
public void updateComponent(int fromRow, int toRow) Request components that attached to this model to re-render a range of row.
Fire ListDataEvent.CONTENTS_CHANGED event for fromRow to toRow.- Parameters:
fromRow
-toRow
-
-
sort
Sort and fire ListDataEvent.CONTENTS_CHANGED event to notify UI component.- Specified by:
sort
in interfaceorg.zkoss.zul.ext.Sortable<Object>
- Parameters:
cmpr
-ascending
-
-
tableChanged
Handle TableModelEvent from GridTable.- Specified by:
tableChanged
in interfaceTableModelListener
- Parameters:
e
-- See Also:
-
setEditing
public void setEditing(boolean b) Set editing to true/false.
When editing is true, do not fire ListDataEvent.CONTENTS_CHANGED event.- Parameters:
b
-
-
getSortDirection
- Specified by:
getSortDirection
in interfaceorg.zkoss.zul.ext.Sortable<Object>
-