Class ListUtils.DefaultEditableModel<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
org.luwrain.controls.ListUtils.DefaultEditableModel<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, SequencedCollection<E>, EditableListArea.Model<E>, ListArea.Model<E>
Enclosing class:
ListUtils

public static class ListUtils.DefaultEditableModel<E> extends ArrayList<E> implements EditableListArea.Model<E>
See Also:
  • Field Details

    • itemClass

      protected final Class<E> itemClass
  • Constructor Details

    • DefaultEditableModel

      public DefaultEditableModel(Class<E> itemClass)
    • DefaultEditableModel

      public DefaultEditableModel(Class<E> itemClass, E[] items)
    • DefaultEditableModel

      public DefaultEditableModel(Class<E> itemClass, List<E> items)
  • Method Details

    • setItems

      public void setItems(E[] items)
    • getItems

      public Object[] getItems()
    • addToModel

      public boolean addToModel(int pos, Supplier<Object> supplier)
      Specified by:
      addToModel in interface EditableListArea.Model<E>
    • removeFromModel

      public boolean removeFromModel(int fromIndex, int toIndex)
      Specified by:
      removeFromModel in interface EditableListArea.Model<E>
    • getItemCount

      public int getItemCount()
      Description copied from interface: ListArea.Model
      Returns the total number of items in the model.
      Specified by:
      getItemCount in interface ListArea.Model<E>
      Returns:
      the item count
    • getItem

      public E getItem(int index)
      Description copied from interface: ListArea.Model
      Returns the item at the given index.
      Specified by:
      getItem in interface ListArea.Model<E>
      Parameters:
      index - the zero-based index of the item
      Returns:
      the item at that position, or null if the index is out of bounds
    • refresh

      public void refresh()
      Description copied from interface: ListArea.Model
      Called when the underlying data has changed and the list needs to be refreshed. Implementations should reload or update their data.
      Specified by:
      refresh in interface ListArea.Model<E>
    • adjust

      protected E adjust(Object o)