Package com.storedobject.vaadin
Class Button
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.button.Button
com.storedobject.vaadin.Button
- All Implemented Interfaces:
HasThemeStyle,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
- Direct Known Subclasses:
ConfirmButton,ObjectViewerButton,PopupButton
Enhancements to Vaadin
Button.
Main features are: (1) A ClickHandler can e defined as the action when button is clicked.
(2) From the text on the button, it will try to create an Icon (unless an icon is already specified),
(3) Enable/disable display of icons on any newly created buttons via method setNoIcons(boolean).- Author:
- Syam
- See Also:
-
Nested Class Summary
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 -
Constructor Summary
ConstructorsConstructorDescriptionButton(com.vaadin.flow.component.Component icon, ClickHandler clickHandler) Constructor.Button(com.vaadin.flow.component.icon.VaadinIcon icon, ClickHandler clickHandler) Constructor.Button(String text, ClickHandler clickHandler) Constructor.Button(String text, com.vaadin.flow.component.Component icon, ClickHandler clickHandler) Constructor.Button(String text, com.vaadin.flow.component.icon.VaadinIcon icon, ClickHandler clickHandler) Constructor.Button(String text, String icon, ClickHandler clickHandler) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddClickHandler(ClickHandler clickHandler) Add a click handler.Mark this Button as Primary.asSmall()Make the button Small.voidsetIcon(com.vaadin.flow.component.Component icon) voidsetIcon(com.vaadin.flow.component.icon.VaadinIcon icon) Set a Vaadin icon as the icon for this button.voidSet icon for this button.static voidsetNoIcons(boolean noIcons) Set "no icons" mode for buttons.Methods inherited from class com.vaadin.flow.component.button.Button
addBlurListener, addFocusListener, addFocusShortcut, click, clickInClient, getIcon, isAutofocus, isDisableOnClick, isIconAfterText, remove, setAutofocus, setDisableOnClick, setEnabled, setIconAfterText, setTextMethods inherited from class 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.HasAriaLabel
getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledByMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabledMethods inherited from interface com.vaadin.flow.component.shared.HasPrefix
getPrefixComponent, setPrefixComponentMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.shared.HasSuffix
getSuffixComponent, setSuffixComponentMethods inherited from interface com.vaadin.flow.component.HasText
getText, getWhiteSpace, setWhiteSpaceMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.storedobject.vaadin.HasThemeStyle
addTheme, clearThemes, getInternalElement, removeTheme, setThemeMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariantsMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipText
-
Constructor Details
-
Button
Constructor.- Parameters:
text- Text label to display and the respective icon will be used (unlesssetNoIcons(boolean)was used to disable the display of icons.clickHandler- Click handler
-
Button
Constructor.- Parameters:
icon- IconclickHandler- Click handler
-
Button
Constructor.- Parameters:
text- Text label to displayicon- Name of the icon to useclickHandler- Click handler
-
Button
Constructor.- Parameters:
text- Text label to displayicon- Icon to useclickHandler- Click handler
-
Button
Constructor.- Parameters:
icon- Icon to useclickHandler- Click handler
-
Button
public Button(String text, com.vaadin.flow.component.icon.VaadinIcon icon, ClickHandler clickHandler) Constructor.- Parameters:
text- Text label to displayicon- Icon to useclickHandler- Click handler
-
-
Method Details
-
addClickHandler
Add a click handler.- Parameters:
clickHandler- Click handler to add- Returns:
- Registration.
-
setIcon
public void setIcon(com.vaadin.flow.component.icon.VaadinIcon icon) Set a Vaadin icon as the icon for this button.- Parameters:
icon- Vaadin icon
-
setIcon
-
setIcon
public void setIcon(com.vaadin.flow.component.Component icon) - Overrides:
setIconin classcom.vaadin.flow.component.button.Button
-
asPrimary
Mark this Button as Primary.- Specified by:
asPrimaryin interfaceHasThemeStyle- Returns:
- Self reference.
-
asSmall
Make the button Small.- Specified by:
asSmallin interfaceHasThemeStyle- Returns:
- Self reference.
-
setNoIcons
public static void setNoIcons(boolean noIcons) Set "no icons" mode for buttons. If this is "on", no icon will be displayed on buttons.- Parameters:
noIcons- True/false.
-