Class ImmutableClassList
- All Implemented Interfaces:
ClassList,Serializable,Iterable<String>,Collection<String>,Set<String>
For internal use only. May be renamed or removed in a future release.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionImmutableClassList(Collection<String> values) Creates a new immutable class list with the given values. -
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
ImmutableClassList
Creates a new immutable class list with the given values.- Parameters:
values- the values of the class list
-
-
Method Details
-
add
- Specified by:
addin interfaceCollection<String>- Specified by:
addin interfaceSet<String>- Overrides:
addin classAbstractCollection<String>
-
iterator
-
size
public int size()- Specified by:
sizein interfaceCollection<String>- Specified by:
sizein interfaceSet<String>- Specified by:
sizein classAbstractCollection<String>
-
bind
Binds the presence of the given class name to the provided signal. The class name is immediately added or removed based on the current signal value when the binding is created. The class is added when the signal value istrueand removed when the value isfalse.After the initial application, the binding is kept synchronized with any subsequent signal value changes while the owning
Elementis in attached state. While a binding for the given class name is active, manual calls toSet.add(Object),Set.remove(Object)orClassList.set(String, boolean)for that name will throw aBindingActiveException. When the element is in detached state, signal value changes have no effect.Bulk operations that indiscriminately replace or clear the class list (for example
Set.clear()or setting theclassattribute viaElement.setAttribute(String, String)) throw aBindingActiveExceptionif any binding is active.Text nodes do not support binding a
Signalto a stylesheet class, because they do not support styling in general. -
bind
Binds the class names to the provided signal. The class list is immediately updated to match the current signal value when the binding is created, and is kept synchronized with any subsequent signal value changes while the element is attached. Only one group binding is allowed per class list.The group binding coexists with static values and individual toggle bindings. Names that appear in both sources are deduplicated by the underlying classList (Set behavior).
Null or empty entries in the list and a
nulllist value are silently ignored.Bulk operations that indiscriminately replace or clear the class list (for example
Set.clear()or setting theclassattribute viaElement.setAttribute(String, String)) throw aBindingActiveExceptionif any binding is active.Text nodes do not support binding a
Signalto stylesheet classes, because they do not support styling in general.
-