com.vaadin.flow.component.

Class HtmlComponent

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent

All Implemented Interfaces:

AttachNotifier, DetachNotifier, HasElement, HasSize, HasStyle, Serializable

Direct Known Subclasses:

Hr, HtmlContainer, IFrame, NativeDetails, Param

public class HtmlComponent extends Component implements HasSize, HasStyle

Base class for a Component that represents a single built-in HTML element.

Since:

1.0

Author:

Vaadin Ltd

See Also:

  • Constructor Details

    • HtmlComponent

      protected HtmlComponent()

      Creates a component with the element type based on the Tag annotation of the sub class.

    • HtmlComponent

      public HtmlComponent(String tagName)

      Creates a component with a new element with the given tag name.

      Parameters:

      tagName - the tag name of the element to use for this component, not null

  • Method Details

    • setTitle

      public void setTitle(String title)

      Sets the title of this component. Browsers typically use the title to show a tooltip when hovering an element or any descendant without a title value of its own.

      Parameters:

      title - the title value to set, or "" to remove any previously set title

    • getTitle

      public Optional<String> getTitle()

      Gets the title of this component.

      Returns:

      an optional title, or an empty optional if no title has been set

      See Also: