Package org.zkoss.bind.proxy
Class ListModelListProxy<E>
java.lang.Object
org.zkoss.zul.AbstractListModel<E>
org.zkoss.zul.ListModelList<E>
org.zkoss.bind.proxy.ListModelListProxy<E>
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,List<E>,javassist.util.proxy.Proxy,FormProxyObject,Pageable,Selectable<E>,Sortable<E>,ListModel<E>,PageableModel
public class ListModelListProxy<E>
extends ListModelList<E>
implements javassist.util.proxy.Proxy, FormProxyObject, Serializable
A ListModelList Proxy
- Since:
- 9.6.0
- Author:
- jameschu
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zul.AbstractListModel
AbstractListModel.DefaultSelectionControl<E> -
Field Summary
Fields inherited from class org.zkoss.zul.ListModelList
_listFields inherited from class org.zkoss.zul.AbstractListModel
_selectionFields inherited from interface org.zkoss.zul.PageableModel
INTERNAL_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends E> c) booleanaddAll(Collection<? extends E> c) voidAdds a listener to the list that's notified each time a change to the data model occurs.voidAdds a listener to the list of listeners to be notified when a PagingEvent happens outside of standard Paging componentbooleanaddToSelection(E obj) Add the specified object into selection.voidcacheSavePropertyBinding(String property, SavePropertyBinding s) Cache save property binding by property stringvoidclear()voidChange the selection to the empty set.clone()Collect all of collect cached save property bindingsbooleanbooleancontainsAll(Collection<?> c) protected <T> TcreateProxyObject(T t) booleanget(int index) intReturns the active page (starting from 0).getCache()getElementAt(int j) Returns the value at the specified index.Get the inner real List.Returns the origin object.intReturns the number of pages.intReturns the number of items per page.Returns the current selection.Returns the selection control for the selection model, if any.intgetSize()Returns the length of the list.getSortDirection(Comparator<E> cmpr) Returns the sort direction of this model for the given comparator.inthashCode()intbooleanisEmpty()booleanReturns whether the form proxy object is dirty or not, including all of its attributes.booleanisSelected(Object obj) Returns whether an object is selected.booleanReturns true if the selection is currently empty.iterator()intlistIterator(int index) booleannotifyChange(E element) Notifies a change of the same element to trigger an event ofListDataEvent.CONTENTS_CHANGED.voidvoidremove(int index) booleanbooleanremoveAll(Collection<?> c) booleanRemove the specified object from selection.voidRemoves a listener from the list that's notified each time a change to the data model occurs.voidRemoves a listener from the list of listeners to be notified when a PagingEvent happens outside of standard Paging componentvoidremoveRange(int fromIndex, int toIndex) Remove from fromIndex(inclusive) to toIndex(exclusive).voidResets all of the changes of this form from the origin object.booleanretainAll(Collection<?> c) voidsetActivePage(int pg) Sets the active page (starting from 0).protected voidsetDirty(boolean d) voidsetFormOwner(Object owner, FormBinding binding) Sets the owner of this form with its binding.voidsetHandler(javassist.util.proxy.MethodHandler mi) voidsetMultiple(boolean multiple) Sets the selection mode to be multiple.voidsetPageSize(int size) Sets the number of items per page.voidSet the property of current form proxy object and it's creatorvoidsetSelection(Collection<? extends E> selection) Replace the current selection with the given set.voidSets the selection control for the selection modelintsize()voidsort()Sort the data model by default or assigned comparator.voidsort(Comparator<E> cmpr, boolean ascending) Sorts the data.subList(int fromIndex, int toIndex) voidSaves all of the changes of this form to the origin object.protected static booleantestEquals(Object e, Object o) Object[]toArray()<T> T[]toArray(T[] a) toString()Methods inherited from class org.zkoss.zul.ListModelList
fireSelectionEventMethods inherited from class org.zkoss.zul.AbstractListModel
fireEvent, getListDataListeners, getTotalSize, isMultiple, newEmptySelection, readSelection, removeAllSelection, retainAllSelection, writeSelectionMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Constructor Details
-
ListModelListProxy
-
-
Method Details
-
getCache
-
onDirtyChange
public void onDirtyChange() -
onDataChange
-
setDirty
protected void setDirty(boolean d) -
addListDataListener
Description copied from class:AbstractListModelAdds a listener to the list that's notified each time a change to the data model occurs.- Specified by:
addListDataListenerin interfaceListModel<E>- Overrides:
addListDataListenerin classAbstractListModel<E>
-
removeListDataListener
Description copied from class:AbstractListModelRemoves a listener from the list that's notified each time a change to the data model occurs.- Specified by:
removeListDataListenerin interfaceListModel<E>- Overrides:
removeListDataListenerin classAbstractListModel<E>
-
getSelection
Description copied from class:AbstractListModelReturns the current selection. It is readonly. Don't modify it directly- Specified by:
getSelectionin interfaceSelectable<E>- Overrides:
getSelectionin classAbstractListModel<E>- Returns:
- the current selection.
-
setSelection
Description copied from class:AbstractListModelReplace the current selection with the given set.If this represents a change to the current selection then notify each ListDataListener, including UI.
- Specified by:
setSelectionin interfaceSelectable<E>- Overrides:
setSelectionin classAbstractListModel<E>
-
isSelected
Description copied from class:AbstractListModelReturns whether an object is selected.- Specified by:
isSelectedin interfaceSelectable<E>- Overrides:
isSelectedin classAbstractListModel<E>
-
isSelectionEmpty
public boolean isSelectionEmpty()Description copied from class:AbstractListModelReturns true if the selection is currently empty.- Specified by:
isSelectionEmptyin interfaceSelectable<E>- Overrides:
isSelectionEmptyin classAbstractListModel<E>
-
addToSelection
Description copied from class:AbstractListModelAdd the specified object into selection.If this represents a change to the current selection then notify each ListDataListener, including UI.
- Specified by:
addToSelectionin interfaceSelectable<E>- Overrides:
addToSelectionin classAbstractListModel<E>- Parameters:
obj- the object to be as selection.- Returns:
- true if it is added successfully; false if
objis not part of the data, or was already selected.
-
removeFromSelection
Description copied from class:AbstractListModelRemove the specified object from selection.If this represents a change to the current selection then notify each ListDataListener, including UI.
- Specified by:
removeFromSelectionin interfaceSelectable<E>- Overrides:
removeFromSelectionin classAbstractListModel<E>- Parameters:
obj- the object to be remove from selection.- Returns:
- whether it is removed successfully
-
clearSelection
public void clearSelection()Description copied from class:AbstractListModelChange the selection to the empty set.If this represents a change to the current selection then notify each ListDataListener, including UI.
- Specified by:
clearSelectionin interfaceSelectable<E>- Overrides:
clearSelectionin classAbstractListModel<E>
-
setMultiple
public void setMultiple(boolean multiple) Description copied from class:AbstractListModelSets the selection mode to be multiple.- Specified by:
setMultiplein interfaceSelectable<E>- Overrides:
setMultiplein classAbstractListModel<E>
-
setSelectionControl
Description copied from interface:SelectableSets the selection control for the selection model- Specified by:
setSelectionControlin interfaceSelectable<E>- Overrides:
setSelectionControlin classAbstractListModel<E>
-
getSelectionControl
Description copied from interface:SelectableReturns the selection control for the selection model, if any.- Specified by:
getSelectionControlin interfaceSelectable<E>- Overrides:
getSelectionControlin classAbstractListModel<E>
-
getPageSize
public int getPageSize()Description copied from interface:PageableReturns the number of items per page.Default: 20.
- Specified by:
getPageSizein interfacePageable- Overrides:
getPageSizein classAbstractListModel<E>
-
setPageSize
Description copied from interface:PageableSets the number of items per page.- Specified by:
setPageSizein interfacePageable- Overrides:
setPageSizein classAbstractListModel<E>- Throws:
WrongValueException
-
getPageCount
public int getPageCount()Description copied from interface:PageableReturns the number of pages. Note: there is at least one page even no item at all.- Specified by:
getPageCountin interfacePageable- Overrides:
getPageCountin classAbstractListModel<E>
-
getActivePage
public int getActivePage()Description copied from interface:PageableReturns the active page (starting from 0).- Specified by:
getActivePagein interfacePageable- Overrides:
getActivePagein classAbstractListModel<E>
-
setActivePage
Description copied from interface:PageableSets the active page (starting from 0).- Specified by:
setActivePagein interfacePageable- Overrides:
setActivePagein classAbstractListModel<E>- Throws:
WrongValueException
-
addPagingEventListener
Description copied from interface:PageableModelAdds a listener to the list of listeners to be notified when a PagingEvent happens outside of standard Paging component- Specified by:
addPagingEventListenerin interfacePageableModel- Overrides:
addPagingEventListenerin classAbstractListModel<E>
-
removePagingEventListener
Description copied from interface:PageableModelRemoves a listener from the list of listeners to be notified when a PagingEvent happens outside of standard Paging component- Specified by:
removePagingEventListenerin interfacePageableModel- Overrides:
removePagingEventListenerin classAbstractListModel<E>
-
removeRange
public void removeRange(int fromIndex, int toIndex) Description copied from class:ListModelListRemove from fromIndex(inclusive) to toIndex(exclusive). If fromIndex equals toIndex, this methods do nothing.- Overrides:
removeRangein classListModelList<E>- Parameters:
fromIndex- the begin index (inclusive) to be removed.toIndex- the end index (exclusive) to be removed.
-
getInnerList
Description copied from class:ListModelListGet the inner real List.- Overrides:
getInnerListin classListModelList<E>
-
getSize
public int getSize()Description copied from interface:ListModelReturns the length of the list. -
getElementAt
Description copied from interface:ListModelReturns the value at the specified index.- Specified by:
getElementAtin interfaceListModel<E>- Overrides:
getElementAtin classListModelList<E>
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceList<E>- Overrides:
addin classListModelList<E>
-
add
-
notifyChange
Description copied from class:ListModelListNotifies a change of the same element to trigger an event ofListDataEvent.CONTENTS_CHANGED.- Overrides:
notifyChangein classListModelList<E>- Returns:
- true if the element exists
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceList<E>- Overrides:
addAllin classListModelList<E>
-
addAll
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>- Overrides:
clearin classListModelList<E>
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceList<E>- Overrides:
containsin classListModelList<E>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>- Overrides:
containsAllin classListModelList<E>
-
get
-
indexOf
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceList<E>- Overrides:
isEmptyin classListModelList<E>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<E>- Overrides:
lastIndexOfin classListModelList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>- Overrides:
listIteratorin classListModelList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>- Overrides:
listIteratorin classListModelList<E>
-
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceList<E>- Overrides:
removein classListModelList<E>
-
remove
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceList<E>- Overrides:
removeAllin classListModelList<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceList<E>- Overrides:
retainAllin classListModelList<E>
-
iterator
-
set
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Overrides:
sizein classListModelList<E>
-
subList
-
toArray
- Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceList<E>- Overrides:
toArrayin classListModelList<E>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceList<E>- Overrides:
toArrayin classListModelList<E>
-
equals
- Specified by:
equalsin interfaceCollection<E>- Specified by:
equalsin interfaceList<E>- Overrides:
equalsin classListModelList<E>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<E>- Specified by:
hashCodein interfaceList<E>- Overrides:
hashCodein classListModelList<E>
-
toString
- Overrides:
toStringin classListModelList<E>
-
sort
Description copied from class:ListModelListSorts the data. -
sort
public void sort()Description copied from interface:SortableSort the data model by default or assigned comparator. Notice that the default implementation does nothing, the model which implements Sortable need to implement this method. -
getSortDirection
Description copied from interface:SortableReturns the sort direction of this model for the given comparator. It must be one of "ascending", "descending" and "natural".Default: "natural".
- Specified by:
getSortDirectionin interfaceSortable<E>- Overrides:
getSortDirectionin classListModelList<E>
-
clone
- Overrides:
clonein classListModelList<E>
-
setHandler
public void setHandler(javassist.util.proxy.MethodHandler mi) - Specified by:
setHandlerin interfacejavassist.util.proxy.Proxy
-
getOriginObject
Description copied from interface:FormProxyObjectReturns the origin object.- Specified by:
getOriginObjectin interfaceFormProxyObject
-
resetFromOrigin
public void resetFromOrigin()Description copied from interface:FormProxyObjectResets all of the changes of this form from the origin object.- Specified by:
resetFromOriginin interfaceFormProxyObject
-
submitToOrigin
Description copied from interface:FormProxyObjectSaves all of the changes of this form to the origin object.- Specified by:
submitToOriginin interfaceFormProxyObject
-
isFormDirty
public boolean isFormDirty()Description copied from interface:FormProxyObjectReturns whether the form proxy object is dirty or not, including all of its attributes.- Specified by:
isFormDirtyin interfaceFormProxyObject
-
setFormOwner
Description copied from interface:FormProxyObjectSets the owner of this form with its binding.- Specified by:
setFormOwnerin interfaceFormProxyObject- Parameters:
owner- the object associated with this form.
-
setPath
Description copied from interface:FormProxyObjectSet the property of current form proxy object and it's creator- Specified by:
setPathin interfaceFormProxyObject- Parameters:
property- p the propertyparent- parent the parent proxy node
-
cacheSavePropertyBinding
Description copied from interface:FormProxyObjectCache save property binding by property string- Specified by:
cacheSavePropertyBindingin interfaceFormProxyObject- Parameters:
property- the property of save property bindings- the save property binding
-
collectCachedSavePropertyBinding
Description copied from interface:FormProxyObjectCollect all of collect cached save property bindings- Specified by:
collectCachedSavePropertyBindingin interfaceFormProxyObject
-
testEquals
-
createProxyObject
protected <T> T createProxyObject(T t)
-