Class OneClickList
java.lang.Object
com.illumon.iris.gui.util.oneclick.OneClickList
- All Implemented Interfaces:
Comparable<OneClickList>,Iterable<String>
-
Constructor Summary
ConstructorsConstructorDescriptionOneClickList(String name) OneClickList(String name, Collection<String> values) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an item to the list.protected voidaddAll(Collection<String> other) voidclear()intcompareTo(OneClickList other) Sorts OneClickLists by pinned (first), then by name.booleancontainsAll(Collection<String> other) booleanbooleanbooleangetItems()getName()booleanisEmpty()iterator()protected voidsetIsUppercase(boolean value) Set uppercase enforcement.protected voidprotected voidsetPinned(boolean value) protected voidsetSorted(boolean value) Set the sorting state of the list.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
OneClickList
-
OneClickList
-
-
Method Details
-
getIsPinned
public boolean getIsPinned() -
setPinned
protected void setPinned(boolean value) -
getIsSorted
public boolean getIsSorted() -
setSorted
protected void setSorted(boolean value) Set the sorting state of the list. When this transitions from false to true the internal list will be sorted. -
getIsUppercase
public boolean getIsUppercase() -
setIsUppercase
protected void setIsUppercase(boolean value) Set uppercase enforcement. When this value is set to true, the internal collection will NOT be modified, but any item inserted withadd()will uppercase the input. -
getItems
-
getItemsCopy
-
getName
-
setName
-
clear
public void clear() -
containsAll
-
addAll
-
add
Add an item to the list. If the list is set as uppercase enforcing, it will uppercase the input. If the list is set as sorted, it will insert the item in the correct place to maintain the sort. If the item already exists, it will not be added again.- Parameters:
item- The item to insert.
-
isEmpty
public boolean isEmpty() -
iterator
-
compareTo
Sorts OneClickLists by pinned (first), then by name.- Specified by:
compareToin interfaceComparable<OneClickList>
-
toString
-