com.vaadin.flow.component.
Class HtmlComponent
All Implemented Interfaces:
AttachNotifier
, DetachNotifier
, HasElement
, HasSize
, HasStyle
, Serializable
Direct Known Subclasses:
Base class for a Component
that represents a single built-in HTML
element.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a component with the element type based on the
Tag
annotation of the sub class.HtmlComponent
(String tagName) Creates a component with a new element with the given tag name.
-
Method Summary
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.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
HtmlComponent
protected HtmlComponent()Creates a component with the element type based on the
Tag
annotation of the sub class. -
HtmlComponent
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, notnull
-
-
Method Details
-
setTitle
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
Gets the title of this component.
Returns:
an optional title, or an empty optional if no title has been set
See Also:
-