Package org.adempiere.webui.component
Class SimpleListModel
java.lang.Object
org.zkoss.zul.AbstractListModel<Object>
org.adempiere.webui.component.SimpleListModel
- All Implemented Interfaces:
Serializable
,org.zkoss.zul.ext.Pageable
,org.zkoss.zul.ext.Selectable<Object>
,org.zkoss.zul.ext.Sortable<Object>
,org.zkoss.zul.ListitemRenderer<Object>
,org.zkoss.zul.ListitemRendererExt
,org.zkoss.zul.ListModel<Object>
,org.zkoss.zul.PageableModel
public class SimpleListModel
extends org.zkoss.zul.AbstractListModel<Object>
implements org.zkoss.zul.ListitemRenderer<Object>, org.zkoss.zul.ListitemRendererExt, org.zkoss.zul.ext.Sortable<Object>
List model for
Listbox
that also implements ListitemRenderer
interface.- 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.ListitemRendererExt
DETACH_ON_RENDER
Fields inherited from interface org.zkoss.zul.PageableModel
INTERNAL_EVENT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add new row at indexvoid
addElement
(Object obj) Append new rowint
getElementAt
(int index) int
getSize()
getSortDirection
(Comparator<Object> cmpr) int
org.zkoss.zul.Listcell
newListcell
(org.zkoss.zul.Listitem item) org.zkoss.zul.Listitem
newListitem
(org.zkoss.zul.Listbox listbox) void
Remove all elementsvoid
removeElement
(Object element) Remove element from listvoid
protected void
renderCell
(int col, org.zkoss.zul.Listitem item, String value) Render textListbox
cell/columnvoid
setElementAt
(Object element, int index) Replace element at indexvoid
setMaxLength
(int[] maxLength) Set max length for each columnvoid
sort
(Comparator<Object> cmpr, boolean ascending) protected StringBuffer
Truncate src to maxLength.
"..." will be added to the end of truncated text to indicate text have been truncated.Methods inherited from class org.zkoss.zul.AbstractListModel
addListDataListener, addPagingEventListener, addToSelection, clearSelection, clone, fireEvent, fireSelectionEvent, getActivePage, getPageCount, getPageSize, getSelection, getSelectionControl, isMultiple, isSelected, isSelectionEmpty, newEmptySelection, readSelection, removeAllSelection, removeFromSelection, removeListDataListener, removePagingEventListener, retainAllSelection, setActivePage, setMultiple, setPageSize, 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
-
Field Details
-
list
List backing this model instance
-
-
Constructor Details
-
SimpleListModel
public SimpleListModel()Default constructor -
SimpleListModel
Create model from list- Parameters:
list
- List<?>
-
-
Method Details
-
getElementAt
- Specified by:
getElementAt
in interfaceorg.zkoss.zul.ListModel<Object>
-
getSize
public int getSize()- Specified by:
getSize
in interfaceorg.zkoss.zul.ListModel<Object>
-
truncate
Truncate src to maxLength.
"..." will be added to the end of truncated text to indicate text have been truncated.- Parameters:
src
- Input textmaxLength
- Maximum length of text- Returns:
- truncated text
-
render
-
renderCell
Render textListbox
cell/column- Parameters:
col
- Column indexitem
- Listitemvalue
- Text content for cell
-
getControls
public int getControls()- Specified by:
getControls
in interfaceorg.zkoss.zul.ListitemRendererExt
-
newListcell
public org.zkoss.zul.Listcell newListcell(org.zkoss.zul.Listitem item) - Specified by:
newListcell
in interfaceorg.zkoss.zul.ListitemRendererExt
-
newListitem
public org.zkoss.zul.Listitem newListitem(org.zkoss.zul.Listbox listbox) - Specified by:
newListitem
in interfaceorg.zkoss.zul.ListitemRendererExt
-
setMaxLength
public void setMaxLength(int[] maxLength) Set max length for each column- Parameters:
maxLength
- int[]
-
addElement
Append new row- Parameters:
obj
- Object
-
add
Add new row at index- Parameters:
index
-obj
- Object
-
removeAllElements
public void removeAllElements()Remove all elements -
removeElement
Remove element from list- Parameters:
element
-
-
setElementAt
Replace element at index- Parameters:
element
- Objectindex
- List index
-
indexOf
-
sort
- Specified by:
sort
in interfaceorg.zkoss.zul.ext.Sortable<Object>
-
getSortDirection
- Specified by:
getSortDirection
in interfaceorg.zkoss.zul.ext.Sortable<Object>
-