Package 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 aComponent
that represents a single built-in HTML element.- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HtmlComponent()
Creates a component with the element type based on theTag
annotation of the sub class.HtmlComponent(String tagName)
Creates a component with a new element with the given tag name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
getTitle()
Gets the title of this component.void
setTitle(String title)
Sets the title of this component.-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, 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 Detail
-
HtmlComponent
protected HtmlComponent()
Creates a component with the element type based on theTag
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, notnull
-
-
Method Detail
-
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:
setTitle(String)
-
-