Package com.vaadin.flow.dom
Interface ElementFactory
public interface ElementFactory
Helpers to create
Element instances.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ElementCreates an<a>element.static ElementcreateAnchor(String href) Creates an<a>with the givenhrefattribute.static ElementcreateAnchor(String href, String textContent) Creates an<a>element with the givenhrefattribute and text content.static ElementcreateBr()Creates a<br>element.static ElementCreates a<button>element.static ElementcreateButton(String textContent) Creates a<button>with the given text content.static ElementCreates a<div>element.static ElementCreates a<div>with the given text content.static ElementCreates an<em>element.static ElementcreateEmphasis(String textContent) Creates an<em>element with the given text content.static ElementCreates an<h1>element.static ElementcreateHeading1(String textContent) Creates a<h1>element with the given text content.static ElementCreates an<h2>element.static ElementcreateHeading2(String textContent) Creates a<h2>element with the given text content.static ElementCreates an<h3>element.static ElementcreateHeading3(String textContent) Creates a<h3>element with the given text content.static ElementCreates an<h4>element.static ElementcreateHeading4(String textContent) Creates a<h4>element with the given text content.static ElementCreates an<h5>element.static ElementcreateHeading5(String textContent) Creates a<h5>element with the given text content.static ElementCreates an<h6>element.static ElementcreateHeading6(String textContent) Creates a<h6>element with the given text content.static ElementcreateHr()Creates an<hr>element.static ElementCreates an<input>element.static ElementcreateInput(String type) Creates an<input>element with the given type.static ElementCreates an<label>element.static ElementcreateLabel(String textContent) Creates an<label>element with the given text content.static ElementCreates an<li>element.static ElementcreateListItem(String textContent) Creates an<li>element with the given text content.static ElementCreates an<option>element.static ElementcreateOption(String textContent) Creates an<option>element with the given text content.static ElementCreates a<p>element.static ElementcreateParagraph(String textContent) Creates a<p>element with the given text content.static ElementCreates a<pre>element.static ElementcreatePreformatted(String textContent) Creates a<pre>element with the given text content.static ElementcreateRouterLink(String href, String textContent) Creates an<a>element with the givenhrefattribute, text content and the router link attribute.static ElementCreates a<select>element.static ElementCreates a<span>element.static ElementcreateSpan(String textContent) Creates a<span>element with the given text content.static ElementCreates a<strong>element.static ElementcreateStrong(String textContent) Creates a<strong>element with the given text content.static ElementCreates a<textarea>element.static ElementCreates a<ul>element.
-
Method Details
-
createAnchor
Creates an<a>element.- Returns:
- an
<a>element.
-
createAnchor
Creates an<a>with the givenhrefattribute.- Parameters:
href- the href attribute for the link- Returns:
- an
<a>element.
-
createAnchor
Creates an<a>element with the givenhrefattribute and text content.- Parameters:
href- the href parameter for the elementtextContent- the text content of the element- Returns:
- an
<a>element.
-
createRouterLink
Creates an<a>element with the givenhrefattribute, 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 element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- an
<h1>element.
-
createHeading2
Creates a<h2>element with the given text content.- Parameters:
textContent- the text content of the element- Returns:
- an
<h2>element.
-
createHeading3
Creates a<h3>element with the given text content.- Parameters:
textContent- the text content of the element- Returns:
- an
<h3>element.
-
createHeading4
Creates a<h4>element with the given text content.- Parameters:
textContent- the text content of the element- Returns:
- an
<h4>element.
-
createHeading5
Creates a<h5>element with the given text content.- Parameters:
textContent- the text content of the element- Returns:
- an
<h5>element.
-
createHeading6
Creates a<h6>element with the given text content.- Parameters:
textContent- the text content of the element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- 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 element- Returns:
- an
<em>element.
-