public class CollectionListModel<T> extends javax.swing.AbstractListModel<T> implements EditableModel
Constructor and Description |
---|
CollectionListModel(java.util.Collection<? extends T> items) |
CollectionListModel(java.util.List<? extends T> items) |
CollectionListModel(java.util.List<T> items,
boolean useListAsIs) |
CollectionListModel(T... items) |
Modifier and Type | Method and Description |
---|---|
void |
add(int i,
T element) |
void |
add(java.util.List<? extends T> elements) |
void |
add(T element) |
void |
addAll(int index,
java.util.List<? extends T> elements) |
void |
addRow() |
void |
allContentsChanged() |
boolean |
canExchangeRows(int oldIndex,
int newIndex) |
boolean |
contains(T item) |
void |
contentsChanged(T element) |
void |
exchangeRows(int oldIndex,
int newIndex) |
T |
getElementAt(int index) |
int |
getElementIndex(T item) |
protected java.util.List<T> |
getInternalList() |
java.util.List<T> |
getItems() |
int |
getSize() |
boolean |
isEmpty() |
protected void |
itemReplaced(T existingItem,
T newItem) |
void |
remove(int index) |
void |
remove(T element) |
void |
removeAll() |
void |
removeRange(int fromIndex,
int toIndex) |
void |
removeRow(int index)
Remove row with index
idx and fire DELETE event (e.g. |
void |
replaceAll(java.util.List<? extends T> elements) |
void |
setElementAt(T item,
int index) |
void |
sort(java.util.Comparator<? super T> comparator) |
java.util.List<T> |
toList() |
java.lang.String |
toString() |
public CollectionListModel(java.util.Collection<? extends T> items)
public CollectionListModel(java.util.List<T> items, boolean useListAsIs)
public CollectionListModel(java.util.List<? extends T> items)
@SafeVarargs public CollectionListModel(T... items)
protected final java.util.List<T> getInternalList()
public int getSize()
getSize
in interface javax.swing.ListModel<T>
public T getElementAt(int index)
getElementAt
in interface javax.swing.ListModel<T>
public void add(T element)
public void add(int i, T element)
public void add(java.util.List<? extends T> elements)
public void addAll(int index, java.util.List<? extends T> elements)
public void remove(T element)
public void setElementAt(T item, int index)
public void remove(int index)
public void removeAll()
public void contentsChanged(T element)
public void allContentsChanged()
public void sort(java.util.Comparator<? super T> comparator)
public java.util.List<T> getItems()
public void replaceAll(java.util.List<? extends T> elements)
public void addRow()
addRow
in interface EditableModel
public void removeRow(int index)
ItemRemovable
idx
and fire DELETE
event (e.g. by calling
AbstractTableModel.fireTableRowsDeleted(int, int)
)removeRow
in interface ItemRemovable
public void exchangeRows(int oldIndex, int newIndex)
exchangeRows
in interface EditableModel
public boolean canExchangeRows(int oldIndex, int newIndex)
canExchangeRows
in interface EditableModel
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<T> toList()
public int getElementIndex(T item)
public boolean isEmpty()
public boolean contains(T item)
public void removeRange(int fromIndex, int toIndex)