Package com.vaadin.flow.dom.impl
Class ThemeListImpl
java.lang.Object
com.vaadin.flow.dom.impl.ThemeListImpl
- All Implemented Interfaces:
ThemeList,Serializable,Iterable<String>,Collection<String>,Set<String>
Default implementation for the
ThemeList that stores the theme names
of the corresponding element. Makes sure that each change to the collection
is reflected in the corresponding element attribute name,
THEME_ATTRIBUTE_NAME.
For internal use only. May be renamed or removed in a future release.
- Since:
- 1.0.
- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionThemeListImpl(Element element) Creates new theme list for element specified. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends String> themeNames) voidBinds the presence of the given theme name to the provided signal so that the theme name is added when the signal value istrueand removed when the value isfalse.voidclear()voidClears all signal bindings.booleanbooleancontainsAll(Collection<?> themeNames) booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> themeNamesToRemove) booleanretainAll(Collection<?> themeNamesToRetain) intsize()Object[]toArray()<T> T[]toArray(T[] a) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Field Details
-
THEME_ATTRIBUTE_NAME
- See Also:
-
-
Constructor Details
-
ThemeListImpl
Creates new theme list for element specified.- Parameters:
element- the element to reflect theme changes onto
-
-
Method Details
-
bind
Description copied from interface:ThemeListBinds the presence of the given theme name to the provided signal so that the theme name is added when the signal value istrueand removed when the value isfalse.While a binding for the given theme name is active, manual calls to
Set.add(Object),Set.remove(Object),ThemeList.set(String, boolean),Set.addAll(Collection),Set.retainAll(Collection)orSet.removeAll(Collection)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 theme list (for example
Set.clear()or setting thethemeattribute viaHasTheme.setThemeName(String)) clear all bindings. -
iterator
-
add
-
addAll
-
remove
-
retainAll
-
removeAll
-
clear
public void clear() -
size
public int size() -
isEmpty
public boolean isEmpty() -
toArray
-
toArray
public <T> T[] toArray(T[] a) -
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<String>- Specified by:
containsAllin interfaceSet<String>
-
toString
-
clearBindings
public void clearBindings()Clears all signal bindings.
-