com.vaadin.flow.component.icon.

Class AbstractIcon<T extends AbstractIcon<T>>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.icon.AbstractIcon<T>

All Implemented Interfaces:

AttachNotifier, ClickNotifier<T>, DetachNotifier, HasElement, HasStyle, HasTooltip, Serializable

Direct Known Subclasses:

FontIcon, Icon, SvgIcon

@Tag("vaadin-icon") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="24.7.0-alpha7") @NpmPackage(value="@vaadin/icon",version="24.7.0-alpha7") @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/icon/src/vaadin-icon.js") public abstract class AbstractIcon<T extends AbstractIcon<T>> extends Component implements ClickNotifier<T>, HasTooltip

Abstract base class for icon components

Author:

Vaadin Ltd

See Also:

  • 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