Class AbstractIcon<T extends AbstractIcon<T>>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.icon.AbstractIcon<T>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.ClickNotifier<T>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, HasTooltip, Serializable
Direct Known Subclasses:
FontIcon, Icon, SvgIcon

@Tag("vaadin-icon") @NpmPackage(value="@vaadin/icon", version="25.0.0-alpha19") @JsModule("@vaadin/icon/src/vaadin-icon.js") public abstract class AbstractIcon<T extends AbstractIcon<T>> extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.ClickNotifier<T>, HasTooltip
Abstract base class for icon components
Author:
Vaadin Ltd
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    Gets the color of this icon as a String.
    abstract void
    Sets the color of the icon.
    void
    Sets the width and the height of the icon.

    Methods 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, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.ClickNotifier

    addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip

    getTooltip, setTooltipText
  • Constructor Details

    • AbstractIcon

      public AbstractIcon()
  • Method Details

    • setSize

      public void setSize(String size)
      Sets the width and the height of the icon.

      The size should be in a format understood by the browser, e.g. "100px" or "2.5em".

      Parameters:
      size - the size to set, may be null to clear the value
    • setColor

      public abstract void setColor(String color)
      Sets the color of the icon.

      The color should be in a format understood by the browser, e.g. "orange", "#FF9E2C" or "rgb(255, 158, 44)".

      Parameters:
      color - the color to set, may be null to clear the value
    • getColor

      public abstract String getColor()
      Gets the color of this icon as a String.
      Returns:
      the color of the icon, or null if the color has not been set