Package snap.util
Class PickList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
snap.util.PickList<E>
- All Implemented Interfaces:
Cloneable
,Iterable<E>
,Collection<E>
,List<E>
A list implementation that includes support for a selection and a synchronized sorted list.
-
Field Summary
Modifier and TypeFieldDescriptionprotected PropChangeSupport
static final String
static final String
static final String
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add list item.void
Add listener.void
clear()
Clears the list.void
clearSel()
Clears the selection.clone()
Standard clone implementation.protected void
firePropChange
(String aProp, Object oldVal, Object newVal, int anIndex) Fires a property change for given property name, old value, new value and index.protected void
firePropChange
(PropChange aPCE) Fires a given property change.get
(int anIndex) Return list item at index.int[]
getIndexesForItems
(E[] theItems) Returns indexes for items.getSel()
Returns the ListSel.int
Returns the selected index.int[]
Returns the selected indices.Returns the selected item.Object[]
Returns the selected item.<T> T[]
getSelItems
(Class<T> aClass) Returns the selected item.boolean
Returns whether list allows multiple selections.boolean
Returns whether selection is empty.boolean
isSelIndex
(int anIndex) Returns whether given index is selected index.remove
(int anIndex) Remove list item.void
Remove listener.void
Selects up in the list.void
selectUp()
Selects up in the list.void
setAll
(Collection<? extends E> aCollection) Sets all items.void
setMultiSel
(boolean aValue) Sets whether list allows multiple selections.void
Sets the ListSel.void
setSelIndex
(int anIndex) Sets the selected index.void
setSelIndexes
(int[] theIndexes) Sets the selected index.void
setSelItem
(E anItem) Sets the selected index.void
setSelItems
(E[] theItems) Sets the selected index.int
size()
Return list size.Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, set, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
_pcs
-
Item_Prop
- See Also:
-
Sel_Prop
- See Also:
-
MultiSel_Prop
- See Also:
-
-
Constructor Details
-
PickList
public PickList()Constructor.
-
-
Method Details
-
size
public int size()Return list size.- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceList<E>
- Specified by:
size
in classAbstractCollection<E>
-
get
Return list item at index. -
add
Add list item. -
remove
Remove list item. -
setAll
Sets all items. -
clear
public void clear()Clears the list.- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceList<E>
- Overrides:
clear
in classAbstractList<E>
-
isMultiSel
public boolean isMultiSel()Returns whether list allows multiple selections. -
setMultiSel
public void setMultiSel(boolean aValue) Sets whether list allows multiple selections. -
getSel
Returns the ListSel. -
setSel
Sets the ListSel. -
isSelEmpty
public boolean isSelEmpty()Returns whether selection is empty. -
isSelIndex
public boolean isSelIndex(int anIndex) Returns whether given index is selected index. -
getSelIndex
public int getSelIndex()Returns the selected index. -
setSelIndex
public void setSelIndex(int anIndex) Sets the selected index. -
getSelIndexes
public int[] getSelIndexes()Returns the selected indices. -
setSelIndexes
public void setSelIndexes(int[] theIndexes) Sets the selected index. -
clearSel
public void clearSel()Clears the selection. -
getSelItem
Returns the selected item. -
setSelItem
Sets the selected index. -
getSelItems
Returns the selected item. -
getSelItems
Returns the selected item. -
setSelItems
Sets the selected index. -
getIndexesForItems
Returns indexes for items. -
selectUp
public void selectUp()Selects up in the list. -
selectDown
public void selectDown()Selects up in the list. -
addPropChangeListener
Add listener. -
removePropChangeListener
Remove listener. -
firePropChange
Fires a property change for given property name, old value, new value and index. -
firePropChange
Fires a given property change. -
clone
Standard clone implementation.
-