@Tag(value="vaadin-drawer-toggle") @NpmPackage(value="@vaadin/vaadin-app-layout", version="20.0.0") @JsModule(value="@vaadin/vaadin-app-layout/src/vaadin-drawer-toggle.js") public class DrawerToggle extends Button
<vaadin-drawer-toggle>
element. It is a
button that allows the user to open and close the drawer. To use it, add it
to the AppLayout
, typically in the navbar slot.
AppLayout layout = new AppLayout();
layout.addToNavbar(new DrawerToggle());
BlurNotifier.BlurEvent<C extends Component>
FocusNotifier.FocusEvent<C extends Component>
Constructor and Description |
---|
DrawerToggle() |
Modifier and Type | Method and Description |
---|---|
void |
setIcon(Component icon)
Sets the given component as the icon of this button.
|
click, clickInClient, getIcon, isAutofocus, isDisableOnClick, isIconAfterText, setAutofocus, setDisableOnClick, setIconAfterText, setText
addThemeVariants, addToPrefix, addToSuffix, isAutofocusBoolean, isDisabledBoolean, remove, removeAll, removeThemeVariants, setDisabled
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
isEnabled, setEnabled
getElement
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
addClickListener, addClickShortcut
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
addBlurListener
addFocusListener
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
addAttachListener
addDetachListener
public void setIcon(Component icon)
Button
Even though you can use almost any component as an icon, some good
options are Icon
and Image
.
Use Button.setIconAfterText(boolean)
to change the icon's position
relative to the button's text content.
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.
Copyright © 2021. All rights reserved.