Package com.storedobject.vaadin
Class ImageButton
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.Component>
com.storedobject.vaadin.Icon
com.storedobject.vaadin.ImageButton
- All Implemented Interfaces:
HasBadgeStyle,HasElement,HasIcon,HasSquareElement,HasStyle,HasThemeStyle,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.ClickNotifier<Icon>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,Serializable
public class ImageButton
extends Icon
implements HasBadgeStyle, com.vaadin.flow.component.HasEnabled
A button that shows only an icon. Since no text is displayed, it saves screen real estate.
- Author:
- Syam
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionImageButton(com.vaadin.flow.component.icon.VaadinIcon icon, ClickHandler clickHandler) Constructor.ImageButton(String iconName, ClickHandler clickHandler) Constructor.ImageButton(String title, com.vaadin.flow.component.icon.VaadinIcon icon, ClickHandler clickHandler) Constructor.ImageButton(String title, String iconName, ClickHandler clickHandler) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionasSmall()Set size to small.final booleanvoidSet the color.voidsetDisabledColor(String color) Set the color when disabled.voidsetEnabled(boolean enabled) withBox()Draw a box around ans set the overall size to 25x25 pixels.withBox(int sizeInPixels) Draw a box around after sizing it.withSize(int sizeInPixels) Set size of the image.Methods inherited from class com.storedobject.vaadin.Icon
addClickHandler, addClickListener, getColor, getHeight, getIcon, getInternalElement, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getSize, getWidth, initContent, setAttribute, setHeight, setIcon, setIcon, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSize, setStyle, setWidthMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, 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
addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.storedobject.vaadin.HasBadgeStyle
clearThemes, removeTheme, setThemeMethods inherited from interface com.storedobject.vaadin.HasElement
getAttribute, getStyleMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasSize
getHeightUnit, getWidthUnit, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullMethods inherited from interface com.storedobject.vaadin.HasStyle
getClassName, getClassNames, getStyle, setClassNameMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, hasClassName, removeClassName, removeClassNames, setClassNameMethods inherited from interface com.storedobject.vaadin.HasThemeStyle
addTheme, asPrimary, getInternalElement
-
Constructor Details
-
ImageButton
Constructor.- Parameters:
iconName- IconclickHandler- Click handler
-
ImageButton
Constructor.- Parameters:
icon- IconclickHandler- Click handler
-
ImageButton
public ImageButton(String title, com.vaadin.flow.component.icon.VaadinIcon icon, ClickHandler clickHandler) Constructor.- Parameters:
title- Title (to be shown as tooltip)icon- IconclickHandler- Click handler
-
ImageButton
Constructor.- Parameters:
title- Title (to be shown as tooltip)iconName- IconclickHandler- Click handler
-
-
Method Details
-
withSize
Set size of the image.- Parameters:
sizeInPixels- Size in pixels- Returns:
- Self reference.
-
asSmall
Set size to small.- Specified by:
asSmallin interfaceHasThemeStyle- Returns:
- Self reference.
-
withBox
Draw a box around ans set the overall size to 25x25 pixels.- Returns:
- Self
-
withBox
Draw a box around after sizing it.- Parameters:
sizeInPixels- Size- Returns:
- Self
-
isEnabled
public final boolean isEnabled()- Specified by:
isEnabledin interfacecom.vaadin.flow.component.HasEnabled
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfacecom.vaadin.flow.component.HasEnabled
-
setColor
-
setDisabledColor
-