Package com.storedobject.vaadin
Interface HasIcon
- All Superinterfaces:
HasElement,com.vaadin.flow.component.HasElement,HasThemeStyle,Serializable
- All Known Implementing Classes:
BadgeIcon,ButtonIcon,Icon,ImageButton
Element that has an Icon.
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetIcon()Get the current icon namestatic StringgetIconName(com.vaadin.flow.component.icon.VaadinIcon icon) Get the name of the Vaadin icon.static StringgetIconName(String icon) Find the real name of the icon to be used from theApplicationEnvironment.default voidsetIcon(com.vaadin.flow.component.icon.VaadinIcon icon) Set a Vaadin icon as the icon.default voidSet the icon name.Methods inherited from interface com.storedobject.vaadin.HasElement
getAttribute, getStyle, setAttribute, setStyleMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.storedobject.vaadin.HasThemeStyle
addTheme, asPrimary, asSmall, clearThemes, getInternalElement, removeTheme, setTheme
-
Method Details
-
setIcon
Set 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");- Parameters:
icon- Name of the Iron icon to set
-
setIcon
default void setIcon(com.vaadin.flow.component.icon.VaadinIcon icon) Set a Vaadin icon as the icon.- Parameters:
icon- Vaadin icon
-
getIcon
-
getIconName
Find the real name of the icon to be used from theApplicationEnvironment.- Parameters:
icon- Name of the icon.- Returns:
- Name of the icon derived from the
ApplicationEnvironment.
-
getIconName
Get the name of the Vaadin icon.- Parameters:
icon- Icon- Returns:
- Name of the icon.
-