java.lang.Object
com.vaadin.flow.component.Component
de.bytestore.hostinger.components.themetoggle.ThemeToggle
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<ThemeToggle>, com.vaadin.flow.component.ClickNotifier<ThemeToggle>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<ThemeToggle>, com.vaadin.flow.component.FocusNotifier<ThemeToggle>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasText, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.shared.HasTooltip, io.jmix.flowui.kit.component.HasTitle, Serializable

@Tag("theme-toggle") @JsModule("./src/theme-switcher/theme-toggle.js") public class ThemeToggle extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.ClickNotifier<ThemeToggle>, com.vaadin.flow.component.Focusable<ThemeToggle>, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasText, com.vaadin.flow.component.shared.HasTooltip, io.jmix.flowui.kit.component.HasTitle
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier

    com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier

    com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText

    com.vaadin.flow.component.HasText.WhiteSpace
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ThemeToggle(com.vaadin.flow.component.Component icon)
     
    ThemeToggle(String text, com.vaadin.flow.component.Component icon)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.shared.Registration
    addThemeChangeListener(com.vaadin.flow.component.ComponentEventListener<ThemeToggle.ThemeToggleThemeChangedEvent> listener)
     
    com.vaadin.flow.component.Component
    Gets the component that is defined as the icon of this button.
     
    boolean
    Get the state for the autofocus property of the button.
    void
    setAutofocus(boolean autofocus)
    Set the button to be input focused when the page loads.
    void
    setIcon(com.vaadin.flow.component.Component icon)
    Sets the given component as the icon of this button.
    void
    setStorageKey(String storageKey)
     
    void
    Sets the given string as the text content of this component.

    Methods inherited from class com.vaadin.flow.component.Component

    findAncestor, from, getChildren, getElement, getId, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, isAttached, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, setId, setVisible

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.BlurNotifier

    addBlurListener

    Methods inherited from interface com.vaadin.flow.component.ClickNotifier

    addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.Focusable

    addFocusShortcut, blur, focus, getTabIndex, setTabIndex

    Methods inherited from interface com.vaadin.flow.component.FocusNotifier

    addFocusListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.component.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.HasText

    getText, getWhiteSpace, setWhiteSpace

    Methods inherited from interface com.vaadin.flow.component.HasTheme

    addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

    Methods inherited from interface io.jmix.flowui.kit.component.HasTitle

    getTitle, setTitle

    Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip

    getTooltip, setTooltipText
  • Field Details

  • Constructor Details

    • ThemeToggle

      public ThemeToggle()
    • ThemeToggle

      public ThemeToggle(com.vaadin.flow.component.Component icon)
    • ThemeToggle

      public ThemeToggle(String text, com.vaadin.flow.component.Component icon)
  • Method Details

    • setText

      public void setText(@Nullable String text)
      Sets the given string as the text content of this component.

      This method removes any existing text-content and replaces it with the given text.

      This method also sets or removes this button's theme=icon attribute based on whether this button contains only an icon after this operation or not.

      Specified by:
      setText in interface com.vaadin.flow.component.HasText
      Parameters:
      text - the text content to set, may be null to only remove existing text
    • getIcon

      public com.vaadin.flow.component.Component getIcon()
      Gets the component that is defined as the icon of this button.
      Returns:
      the icon of this button, or null if the icon is not set
    • setIcon

      public void setIcon(@Nullable com.vaadin.flow.component.Component icon)
      Sets the given component as the icon of this button.

      Even though you can use almost any component as an icon, some good options are Icon and Image.

      This method also sets or removes this button's theme=icon attribute based on whether this button contains only an icon after this operation or not.

      Parameters:
      icon - component to be used as an icon, may be null to only remove the current icon, can't be a text-node
    • isAutofocus

      public boolean isAutofocus()
      Get the state for the autofocus property of the button.

      This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

      Returns:
      the autofocus property from the button
    • setAutofocus

      public void setAutofocus(boolean autofocus)
      Set the button to be input focused when the page loads.
      Parameters:
      autofocus - the boolean value to set
    • getStorageKey

      public String getStorageKey()
    • setStorageKey

      public void setStorageKey(String storageKey)
    • addThemeChangeListener

      public com.vaadin.flow.shared.Registration addThemeChangeListener(com.vaadin.flow.component.ComponentEventListener<ThemeToggle.ThemeToggleThemeChangedEvent> listener)