Klasse ToolbarSwitch
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.button.Button
com.vaadin.componentfactory.toolbar.ToolbarSwitch
- Alle implementierten Schnittstellen:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.button.Button>,com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.button.Button>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.button.Button>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.button.Button>,com.vaadin.flow.component.HasAriaLabel,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.HasPrefix,com.vaadin.flow.component.shared.HasSuffix,com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.button.ButtonVariant>,com.vaadin.flow.component.shared.HasTooltip,Serializable
public class ToolbarSwitch
extends com.vaadin.flow.component.button.Button
A button for the toolbar, that provides a "switch" like functionality. Clicking it will toggle it to "active / on",
allowing to represent active functionality.
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic classThis event is fired, when a switch's active state changes.Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen com.vaadin.flow.component.HasText
com.vaadin.flow.component.HasText.WhiteSpace -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates a new instance.ToolbarSwitch(com.vaadin.flow.component.Component icon) Creates a new instance with the given icon.ToolbarSwitch(com.vaadin.flow.component.Component icon, com.vaadin.flow.component.Component suffixIcon) Creates a new instance with the given icons.ToolbarSwitch(com.vaadin.flow.component.icon.VaadinIcon icon) Creates a new instance with the given icon.ToolbarSwitch(com.vaadin.flow.component.icon.VaadinIcon icon, com.vaadin.flow.component.icon.VaadinIcon suffixIcon) Creates a new instance with the given icons.ToolbarSwitch(String text) Creates a new instance with the given text as its label.ToolbarSwitch(String text, com.vaadin.flow.component.Component icon) Creates a new instance with the given label text and icon. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcom.vaadin.flow.shared.RegistrationaddActiveChangedListener(com.vaadin.flow.component.ComponentEventListener<ToolbarSwitch.ActiveChangedEvent> listener) Adds a listener, that will be notified, when this switch is activated.booleanisActive()Indicates, if this switch is active or not.voidsetActive(boolean active) Sets an explicit active statebooleantoggle()Toggles the "active" state.Von Klasse geerbte Methoden com.vaadin.flow.component.button.Button
addBlurListener, addFocusListener, addFocusShortcut, click, clickInClient, getIcon, isAutofocus, isDisableOnClick, isIconAfterText, remove, setAutofocus, setDisableOnClick, setEnabled, setIcon, setIconAfterText, setTextVon Klasse geerbte Methoden com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden com.vaadin.flow.component.AttachNotifier
addAttachListenerVon Schnittstelle geerbte Methoden com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerVon Schnittstelle geerbte Methoden com.vaadin.flow.component.DetachNotifier
addDetachListenerVon Schnittstelle geerbte Methoden com.vaadin.flow.component.Focusable
blur, focus, getTabIndex, setTabIndexVon Schnittstelle geerbte Methoden com.vaadin.flow.component.HasAriaLabel
getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledByVon Schnittstelle geerbte Methoden com.vaadin.flow.component.HasElement
getElementVon Schnittstelle geerbte Methoden com.vaadin.flow.component.HasEnabled
isEnabledVon Schnittstelle geerbte Methoden com.vaadin.flow.component.shared.HasPrefix
getPrefixComponent, setPrefixComponentVon Schnittstelle geerbte Methoden 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, setWidthFullVon Schnittstelle geerbte Methoden com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameVon Schnittstelle geerbte Methoden com.vaadin.flow.component.shared.HasSuffix
getSuffixComponent, setSuffixComponentVon Schnittstelle geerbte Methoden com.vaadin.flow.component.HasText
getText, getWhiteSpace, setWhiteSpaceVon Schnittstelle geerbte Methoden com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameVon Schnittstelle geerbte Methoden com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariantsVon Schnittstelle geerbte Methoden com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipText
-
Konstruktordetails
-
ToolbarSwitch
public ToolbarSwitch()Creates a new instance. -
ToolbarSwitch
Creates a new instance with the given text as its label.- Parameter:
text- label text
-
ToolbarSwitch
public ToolbarSwitch(com.vaadin.flow.component.Component icon) Creates a new instance with the given icon.- Parameter:
icon- icon
-
ToolbarSwitch
public ToolbarSwitch(com.vaadin.flow.component.icon.VaadinIcon icon) Creates a new instance with the given icon.- Parameter:
icon- icon
-
ToolbarSwitch
public ToolbarSwitch(com.vaadin.flow.component.icon.VaadinIcon icon, com.vaadin.flow.component.icon.VaadinIcon suffixIcon) Creates a new instance with the given icons. The second icon is displayed smaller and elevated as an addition to the first icon.- Parameter:
icon- iconsuffixIcon- additonal / suffix icon
-
ToolbarSwitch
public ToolbarSwitch(com.vaadin.flow.component.Component icon, com.vaadin.flow.component.Component suffixIcon) Creates a new instance with the given icons. The second icon is displayed smaller and elevated as an addition to the first icon.- Parameter:
icon- iconsuffixIcon- additonal / suffix icon
-
ToolbarSwitch
Creates a new instance with the given label text and icon.- Parameter:
text- label texticon- icon
-
-
Methodendetails
-
toggle
public boolean toggle()Toggles the "active" state.- Gibt zurück:
- new active state
-
setActive
public void setActive(boolean active) Sets an explicit active state- Parameter:
active- new active state
-
isActive
public boolean isActive()Indicates, if this switch is active or not.- Gibt zurück:
- is active
-
addActiveChangedListener
public com.vaadin.flow.shared.Registration addActiveChangedListener(com.vaadin.flow.component.ComponentEventListener<ToolbarSwitch.ActiveChangedEvent> listener) Adds a listener, that will be notified, when this switch is activated.- Parameter:
listener- listener- Gibt zurück:
- registration to remove the listener
-