Class LabelStack
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<String>
-
- org.eclipse.nebula.widgets.nattable.layer.LabelStack
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,Deque<String>
,List<String>
,Queue<String>
public class LabelStack extends LinkedList<String>
Collection of labels applied to a cell. Used for conditional styling and behavior.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description LabelStack(String... labels)
Creates aLabelStack
initialized with the given labels.LabelStack(Collection<String> labels)
Creates aLabelStack
initialized with the given labels.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
addLabel(String label)
Adds a label to the bottom of the label stack.void
addLabelOnTop(String label)
Adds a label to the top of the label stack.List<String>
getLabels()
Deprecated.AsLabelStack
is itself a collection, the usage of this method is not needed anymore.boolean
hasLabel(String label)
Check if the given label is on the label stack.boolean
removeLabel(String label)
Removes the given label from the label stack.-
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
-
Methods inherited from class java.util.AbstractSequentialList
iterator
-
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, 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
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
-
-
-
Constructor Detail
-
LabelStack
public LabelStack(String... labels)
Creates aLabelStack
initialized with the given labels.- Parameters:
labels
- The labels that should be initially added to the createdLabelStack
.
-
LabelStack
public LabelStack(Collection<String> labels)
Creates aLabelStack
initialized with the given labels.- Parameters:
labels
- The labels that should be initially added to the createdLabelStack
.- Since:
- 2.0
-
-
Method Detail
-
addLabel
public boolean addLabel(String label)
Adds a label to the bottom of the label stack.- Parameters:
label
- The label to add.- Returns:
true
if the label was added,false
if adding failed.- Since:
- 2.0
-
addLabelOnTop
public void addLabelOnTop(String label)
Adds a label to the top of the label stack. If the label is already in the label stack it is moved to the top.- Parameters:
label
- The label to add.
-
getLabels
@Deprecated public List<String> getLabels()
Deprecated.AsLabelStack
is itself a collection, the usage of this method is not needed anymore.- Returns:
- The label stack collection.
-
hasLabel
public boolean hasLabel(String label)
Check if the given label is on the label stack.- Parameters:
label
- The label to test.- Returns:
true
if the label stack contains the given label,false
if not.
-
removeLabel
public boolean removeLabel(String label)
Removes the given label from the label stack.- Parameters:
label
- The label to remove.- Returns:
true
if the label was removed,false
if not.
-
-