Package com.storedobject.vaadin
Class Icon
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.Component>
com.storedobject.vaadin.Icon
- All Implemented Interfaces:
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.HasSize,com.vaadin.flow.component.HasStyle,Serializable
- Direct Known Subclasses:
BadgeIcon,ImageButton
public class Icon
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.Component>
implements HasStyle, HasIcon, HasSquareElement, com.vaadin.flow.component.ClickNotifier<Icon>
Enhancements to Vaadin's Icon to handle other collections in a generic way.
- Author:
- Syam
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddClickHandler(ClickHandler clickHandler) Add click handler.com.vaadin.flow.shared.RegistrationaddClickListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<Icon>> listener) getColor()Get the current color.getIcon()Get the current icon namecom.vaadin.flow.dom.ElementGet the internal element to which style will be applied.getSize()Get the current sizegetWidth()protected com.vaadin.flow.component.ComponentvoidsetAttribute(String name, String value) Set an attribute value.voidSet the color.voidvoidsetIcon(com.vaadin.flow.component.icon.VaadinIcon icon) Set a Vaadin icon as the icon.voidSet the icon name.voidsetMaxHeight(String maxHeight) voidsetMaxWidth(String maxWidth) voidsetMinHeight(String minHeight) voidsetMinWidth(String minWidth) voidSet the size (Width and height)voidSet a style value.voidMethods 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.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, asSmall, clearThemes, removeTheme, setTheme
-
Constructor Details
-
Icon
public Icon(com.vaadin.flow.component.icon.VaadinIcon icon) Create from a Vaadin icon- Parameters:
icon- Vaadin icon
-
Icon
Create from an icon from the name. It could specify the collection name too. SeesetIcon(String).- Parameters:
icon- Name of the Iron icon
-
-
Method Details
-
initContent
protected com.vaadin.flow.component.Component initContent()- Overrides:
initContentin classcom.vaadin.flow.component.Composite<com.vaadin.flow.component.Component>
-
getInternalElement
public com.vaadin.flow.dom.Element getInternalElement()Description copied from interface:HasStyleGet the internal element to which style will be applied.- Specified by:
getInternalElementin interfaceHasStyle- Specified by:
getInternalElementin interfaceHasThemeStyle- Returns:
- The internal element.
-
setIcon
-
setIcon
Description copied from interface:HasIconSet the icon name.In addition to Vaadin's icons, icons from Polymer Iron Icons are included.
Note: The name could be structured to denote collection too. Available collections are "vaadin", "icons", "av", "communication", "device", "editor", "hardware", "image", "maps", "notifications", "social", and "places". For example, if you want to use the "bluetooth" icon from the "device" collection -
Icon icon = new Icon("device:bluetooth"); OR icon.setIcon("device:bluetooth"); -
getIcon
-
setSize
Description copied from interface:HasSquareElementSet the size (Width and height)- Specified by:
setSizein interfaceHasSquareElement- Parameters:
size- Width/height of the square. Null value will remove the width/height styles.
-
getSize
Description copied from interface:HasSquareElementGet the current size- Specified by:
getSizein interfaceHasSquareElement- Returns:
- Current size
-
setWidth
- Specified by:
setWidthin interfacecom.vaadin.flow.component.HasSize
-
setMinWidth
- Specified by:
setMinWidthin interfacecom.vaadin.flow.component.HasSize
-
setMaxWidth
- Specified by:
setMaxWidthin interfacecom.vaadin.flow.component.HasSize
-
getWidth
- Specified by:
getWidthin interfacecom.vaadin.flow.component.HasSize
-
getMinWidth
- Specified by:
getMinWidthin interfacecom.vaadin.flow.component.HasSize
-
getMaxWidth
- Specified by:
getMaxWidthin interfacecom.vaadin.flow.component.HasSize
-
setHeight
- Specified by:
setHeightin interfacecom.vaadin.flow.component.HasSize
-
setMinHeight
- Specified by:
setMinHeightin interfacecom.vaadin.flow.component.HasSize
-
setMaxHeight
- Specified by:
setMaxHeightin interfacecom.vaadin.flow.component.HasSize
-
getHeight
- Specified by:
getHeightin interfacecom.vaadin.flow.component.HasSize
-
getMinHeight
- Specified by:
getMinHeightin interfacecom.vaadin.flow.component.HasSize
-
getMaxHeight
- Specified by:
getMaxHeightin interfacecom.vaadin.flow.component.HasSize
-
setColor
-
getColor
-
setStyle
Set a style value.- Specified by:
setStylein interfaceHasElement- Parameters:
name- Name of the style.value- Value of the style.
-
setAttribute
Set an attribute value.- Specified by:
setAttributein interfaceHasElement- Parameters:
name- Name of the attribute.value- Value of the attribute.
-
addClickHandler
Add click handler.- Parameters:
clickHandler- Click handler- Returns:
- Registration.
-
addClickListener
-