Package org.zkoss.zul

Class ListModelList<E>

java.lang.Object
org.zkoss.zul.AbstractListModel<E>
org.zkoss.zul.ListModelList<E>
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>, Pageable, Selectable<E>, Sortable<E>, ListModel<E>, PageableModel

public class ListModelList<E> extends AbstractListModel<E> implements Sortable<E>, List<E>, Serializable

This is the ListModel as a List to be used with Listbox. Add or remove the contents of this model as a List would cause the associated Listbox to change accordingly.

For more information, please refer to ZK Developer's Reference: List Model

Author:
Henri Chen
See Also:
  • Field Details

    • _list

      protected List<E> _list
  • Constructor Details

    • ListModelList

      public ListModelList(List<E> list, boolean live)
      Constructor
      Parameters:
      list - the list to represent
      live - whether to have a 'live' ListModel on top of the specified list. If false, the content of the specified list is copied. If true, this object is a 'facade' of the specified list, i.e., when you add or remove items from this ListModelList, the inner "live" list would be changed accordingly. However, it is not a good idea to modify list if it is passed to this method with live is true, since Listbox is not smart enough to handle it. Instead, modify it thru this object.
      Since:
      2.4.0
    • ListModelList

      public ListModelList()
      Constructor.
    • ListModelList

      public ListModelList(Collection<? extends E> c)
      Constructor. It makes a copy of the specified collection (i.e., not live).

      Notice that if the data is static or not shared, it is better to use ListModelList(c, true) instead, since making a copy is slower.

    • ListModelList

      public ListModelList(E[] array)
      Constructor. It makes a copy of the specified array (i.e., not live).
      Since:
      2.4.1
    • ListModelList

      public ListModelList(int initialCapacity)
      Constructor.
      Parameters:
      initialCapacity - the initial capacity for this ListModelList.
  • Method Details