Interface ThemeList
- All Superinterfaces:
Collection<String>,Iterable<String>,Serializable,Set<String>
- All Known Implementing Classes:
ThemeListImpl
Element.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault SignalBinding<List<String>> Binds the theme names to the provided signal so that the theme list is dynamically updated to match the signal's value.default SignalBinding<Boolean> Binds 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.default booleanSets or removes the given theme name, based on thesetparameter.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
set
Sets or removes the given theme name, based on thesetparameter.- Parameters:
themeName- the theme name to set or removeset- true to set the theme name, false to remove it- Returns:
- true if the theme list was modified (theme name added or removed), false otherwise
-
bind
Binds 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),set(String, boolean),Set.addAll(Collection),Set.retainAll(Collection)orSet.removeAll(Collection)for that name will throw aBindingActiveException. 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)) throw aBindingActiveExceptionif any binding is active.- Parameters:
name- the theme name to bind, notnullor blanksignal- the boolean signal to bind to, notnull- Throws:
BindingActiveException- thrown when there is already an existing binding- Since:
- 25.1
-
bind
Binds the theme names to the provided signal so that the theme list is dynamically updated to match the signal's value. Only one group binding is allowed per theme list.The group binding coexists with static values and individual toggle bindings. Names that appear in both sources may appear as duplicates in the
themeattribute.Null or empty entries in the list and a
nulllist value are silently ignored.Bulk operations that indiscriminately replace or clear the theme list (for example
Set.clear()or setting thethemeattribute viaHasTheme.setThemeName(String)) throw aBindingActiveExceptionif any binding is active.- Parameters:
names- the signal providing the list of theme names, notnull- Throws:
BindingActiveException- thrown when there is already an existing group binding- Since:
- 25.1
-