Class ThemeChangeEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<Component>
com.flowingcode.vaadin.addons.demo.ThemeChangeEvent
- All Implemented Interfaces:
Serializable
Event fired when a theme change occurs in the application. It contains information about the new
ColorScheme and DynamicTheme.- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionThemeChangeEvent(Component source, boolean fromClient, ColorScheme colorScheme, DynamicTheme dynamicTheme) Constructs a newThemeChangeEvent. -
Method Summary
Modifier and TypeMethodDescriptionReturns the dynamic theme applied, if any.Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListenerMethods inherited from class java.util.EventObject
toString
-
Constructor Details
-
ThemeChangeEvent
public ThemeChangeEvent(Component source, boolean fromClient, ColorScheme colorScheme, DynamicTheme dynamicTheme) Constructs a newThemeChangeEvent.- Parameters:
source- the source component of the eventfromClient- true if the event originated from the client side, false otherwisecolorScheme- the new color scheme applieddynamicTheme- the new dynamic theme applied (may be null)
-
-
Method Details
-
getDynamicTheme
Returns the dynamic theme applied, if any.- Returns:
- an
Optionalcontaining the dynamic theme, or empty if dynamic theming is not initialized.
-