com.vaadin.flow.dom.
Interface ElementFactory
Helpers to create Element
instances.
Since:
1.0
Author:
Vaadin Ltd
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic Element
Creates an
<a>
element.static Element
createAnchor
(String href) Creates an
<a>
with the givenhref
attribute.static Element
createAnchor
(String href, String textContent) Creates an
<a>
element with the givenhref
attribute and text content.static Element
createBr()
Creates a
<br>
element.static Element
Creates a
<button>
element.static Element
createButton
(String textContent) Creates a
<button>
with the given text content.static Element
Creates a
<div>
element.static Element
Creates a
<div>
with the given text content.static Element
Creates an
<em>
element.static Element
createEmphasis
(String textContent) Creates an
<em>
element with the given text content.static Element
Creates an
<h1>
element.static Element
createHeading1
(String textContent) Creates a
<h1>
element with the given text content.static Element
Creates an
<h2>
element.static Element
createHeading2
(String textContent) Creates a
<h2>
element with the given text content.static Element
Creates an
<h3>
element.static Element
createHeading3
(String textContent) Creates a
<h3>
element with the given text content.static Element
Creates an
<h4>
element.static Element
createHeading4
(String textContent) Creates a
<h4>
element with the given text content.static Element
Creates an
<h5>
element.static Element
createHeading5
(String textContent) Creates a
<h5>
element with the given text content.static Element
Creates an
<h6>
element.static Element
createHeading6
(String textContent) Creates a
<h6>
element with the given text content.static Element
createHr()
Creates an
<hr>
element.static Element
Creates an
<input>
element.static Element
createInput
(String type) Creates an
<input>
element with the given type.static Element
Creates an
<label>
element.static Element
createLabel
(String textContent) Creates an
<label>
element with the given text content.static Element
Creates an
<li>
element.static Element
createListItem
(String textContent) Creates an
<li>
element with the given text content.static Element
Creates an
<option>
element.static Element
createOption
(String textContent) Creates an
<option>
element with the given text content.static Element
Creates a
<p>
element.static Element
createParagraph
(String textContent) Creates a
<p>
element with the given text content.static Element
Creates a
<pre>
element.static Element
createPreformatted
(String textContent) Creates a
<pre>
element with the given text content.static Element
createRouterLink
(String href, String textContent) Creates an
<a>
element with the givenhref
attribute, text content and the router link attribute.static Element
Creates a
<select>
element.static Element
Creates a
<span>
element.static Element
createSpan
(String textContent) Creates a
<span>
element with the given text content.static Element
Creates a
<strong>
element.static Element
createStrong
(String textContent) Creates a
<strong>
element with the given text content.static Element
Creates a
<textarea>
element.static Element
Creates a
<ul>
element.
-
Method Details
-
createAnchor
Creates an
<a>
element.Returns:
an
<a>
element. -
createAnchor
Creates an
<a>
with the givenhref
attribute.Parameters:
href
- the href attribute for the linkReturns:
an
<a>
element. -
createAnchor
Creates an
<a>
element with the givenhref
attribute and text content.Parameters:
href
- the href parameter for the elementtextContent
- the text content of the elementReturns:
an
<a>
element. -
createRouterLink
Creates an
<a>
element with the givenhref
attribute, text content and the router link attribute. Router links are handled by the framework to perform view navigation without a page reload.Parameters:
href
- the href parameter for the elementtextContent
- the text content of the elementReturns:
an
<a>
element. -
createBr
Creates a
<br>
element.Returns:
a
<br>
element. -
createButton
Creates a
<button>
element.Returns:
a
<button>
element. -
createButton
Creates a
<button>
with the given text content.Parameters:
textContent
- the text content of the elementReturns:
a
<button>
element. -
createDiv
Creates a
<div>
element.Returns:
a
<div>
element. -
createDiv
Creates a
<div>
with the given text content.Parameters:
textContent
- the text content of the elementReturns:
a
<div>
element. -
createHeading1
Creates an
<h1>
element.Returns:
an
<h1>
element. -
createHeading2
Creates an
<h2>
element.Returns:
an
<h2>
element. -
createHeading3
Creates an
<h3>
element.Returns:
an
<h3>
element. -
createHeading4
Creates an
<h4>
element.Returns:
an
<h4>
element. -
createHeading5
Creates an
<h5>
element.Returns:
an
<h5>
element. -
createHeading6
Creates an
<h6>
element.Returns:
an
<h6>
element. -
createHeading1
Creates a
<h1>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<h1>
element. -
createHeading2
Creates a
<h2>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<h2>
element. -
createHeading3
Creates a
<h3>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<h3>
element. -
createHeading4
Creates a
<h4>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<h4>
element. -
createHeading5
Creates a
<h5>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<h5>
element. -
createHeading6
Creates a
<h6>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<h6>
element. -
createHr
Creates an
<hr>
element.Returns:
an
<hr>
element. -
createInput
Creates an
<input>
element.Returns:
an
<input>
element. -
createInput
Creates an
<input>
element with the given type.Parameters:
type
- the type attribute for the elementReturns:
an
<input>
element -
createLabel
Creates an
<label>
element.Returns:
an
<label>
element. -
createLabel
Creates an
<label>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<label>
element. -
createListItem
Creates an
<li>
element.Returns:
an
<li>
element. -
createListItem
Creates an
<li>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<li>
element. -
createOption
Creates an
<option>
element.Returns:
an
<option>
element. -
createOption
Creates an
<option>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<option>
element. -
createParagraph
Creates a
<p>
element.Returns:
a
<p>
element. -
createParagraph
Creates a
<p>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
a
<p>
element. -
createPreformatted
Creates a
<pre>
element.Returns:
a
<pre>
element. -
createPreformatted
Creates a
<pre>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
a
<pre>
element. -
createSelect
Creates a
<select>
element.Returns:
a
<select>
element. -
createSpan
Creates a
<span>
element.Returns:
a
<span>
element. -
createSpan
Creates a
<span>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
a
<span>
element. -
createTextarea
Creates a
<textarea>
element.Returns:
a
<textarea>
element. -
createUnorderedList
Creates a
<ul>
element.Returns:
a
<ul>
element. -
createStrong
Creates a
<strong>
element.Returns:
a
<strong>
element. -
createStrong
Creates a
<strong>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
a
<strong>
element -
createEmphasis
Creates an
<em>
element.Returns:
an
<em>
element. -
createEmphasis
Creates an
<em>
element with the given text content.Parameters:
textContent
- the text content of the elementReturns:
an
<em>
element.
-