Package com.vaadin.flow.dom
Interface ClassList
- All Superinterfaces:
Collection<String>,Iterable<String>,Serializable,Set<String>
- All Known Implementing Classes:
ImmutableClassList,OverlayClassListProxy
Representation of the class names for an
Element.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidBinds the presence of the given class name to the provided signal so that the class is added when the signal value istrueand removed when the value isfalse.default booleanSets or removes the given class name, based on thesetparameter.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
set
Sets or removes the given class name, based on thesetparameter.- Parameters:
className- the class name to set or removeset- true to set the class name, false to remove it- Returns:
- true if the class list was modified (class name added or removed), false otherwise
-
bind
Binds the presence of the given class name to the provided signal so that the class is added when the signal value istrueand removed when the value isfalse.While a binding for the given class name is active, manual calls to
Set.add(Object),Set.remove(Object)orset(String, boolean)for that name will throw acom.vaadin.flow.dom.BindingActiveException. Bindings are lifecycle-aware and only active while the owningElementis in attached state; they are deactivated while the element is in detached state.Bulk operations that indiscriminately replace or clear the class list (for example
Set.clear()or setting theclassattribute viaElement.setAttribute(String, String)) clear all bindings.- Parameters:
name- the class name to bind, notnullor blanksignal- the boolean signal to bind to, notnull- Throws:
BindingActiveException- thrown when there is already an existing binding- Since:
- 25.0
-