Package com.vaadin.flow.dom
Interface ElementFactory
-
public interface ElementFactory
Helpers to createElement
instances.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Method Summary
Static Methods Modifier and Type Method Description static Element
createAnchor()
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
createButton()
Creates a<button>
element.static Element
createButton(String textContent)
Creates a<button>
with the given text content.static Element
createDiv()
Creates a<div>
element.static Element
createDiv(String textContent)
Creates a<div>
with the given text content.static Element
createEmphasis()
Creates an<em>
element.static Element
createEmphasis(String textContent)
Creates an<em>
element with the given text content.static Element
createHeading1()
Creates an<h1>
element.static Element
createHeading1(String textContent)
Creates a<h1>
element with the given text content.static Element
createHeading2()
Creates an<h2>
element.static Element
createHeading2(String textContent)
Creates a<h2>
element with the given text content.static Element
createHeading3()
Creates an<h3>
element.static Element
createHeading3(String textContent)
Creates a<h3>
element with the given text content.static Element
createHeading4()
Creates an<h4>
element.static Element
createHeading4(String textContent)
Creates a<h4>
element with the given text content.static Element
createHeading5()
Creates an<h5>
element.static Element
createHeading5(String textContent)
Creates a<h5>
element with the given text content.static Element
createHeading6()
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
createInput()
Creates an<input>
element.static Element
createInput(String type)
Creates an<input>
element with the given type.static Element
createLabel()
Creates an<label>
element.static Element
createLabel(String textContent)
Creates an<label>
element with the given text content.static Element
createListItem()
Creates an<li>
element.static Element
createListItem(String textContent)
Creates an<li>
element with the given text content.static Element
createOption()
Creates an<option>
element.static Element
createOption(String textContent)
Creates an<option>
element with the given text content.static Element
createParagraph()
Creates a<p>
element.static Element
createParagraph(String textContent)
Creates a<p>
element with the given text content.static Element
createPreformatted()
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
createSelect()
Creates a<select>
element.static Element
createSpan()
Creates a<span>
element.static Element
createSpan(String textContent)
Creates a<span>
element with the given text content.static Element
createStrong()
Creates a<strong>
element.static Element
createStrong(String textContent)
Creates a<strong>
element with the given text content.static Element
createTextarea()
Creates a<textarea>
element.static Element
createUnorderedList()
Creates a<ul>
element.
-
-
-
Method Detail
-
createAnchor
static Element createAnchor()
Creates an<a>
element.- Returns:
- an
<a>
element.
-
createAnchor
static Element createAnchor(String href)
Creates an<a>
with the givenhref
attribute.- Parameters:
href
- the href attribute for the link- Returns:
- an
<a>
element.
-
createAnchor
static Element createAnchor(String href, String textContent)
Creates an<a>
element with the givenhref
attribute and text content.- Parameters:
href
- the href parameter for the elementtextContent
- the text content of the element- Returns:
- an
<a>
element.
-
createRouterLink
static Element createRouterLink(String href, String textContent)
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 element- Returns:
- an
<a>
element.
-
createBr
static Element createBr()
Creates a<br>
element.- Returns:
- a
<br>
element.
-
createButton
static Element createButton()
Creates a<button>
element.- Returns:
- a
<button>
element.
-
createButton
static Element createButton(String textContent)
Creates a<button>
with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- a
<button>
element.
-
createDiv
static Element createDiv()
Creates a<div>
element.- Returns:
- a
<div>
element.
-
createDiv
static Element createDiv(String textContent)
Creates a<div>
with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- a
<div>
element.
-
createHeading1
static Element createHeading1()
Creates an<h1>
element.- Returns:
- an
<h1>
element.
-
createHeading2
static Element createHeading2()
Creates an<h2>
element.- Returns:
- an
<h2>
element.
-
createHeading3
static Element createHeading3()
Creates an<h3>
element.- Returns:
- an
<h3>
element.
-
createHeading4
static Element createHeading4()
Creates an<h4>
element.- Returns:
- an
<h4>
element.
-
createHeading5
static Element createHeading5()
Creates an<h5>
element.- Returns:
- an
<h5>
element.
-
createHeading6
static Element createHeading6()
Creates an<h6>
element.- Returns:
- an
<h6>
element.
-
createHeading1
static Element createHeading1(String textContent)
Creates a<h1>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- an
<h1>
element.
-
createHeading2
static Element createHeading2(String textContent)
Creates a<h2>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- an
<h2>
element.
-
createHeading3
static Element createHeading3(String textContent)
Creates a<h3>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- an
<h3>
element.
-
createHeading4
static Element createHeading4(String textContent)
Creates a<h4>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- an
<h4>
element.
-
createHeading5
static Element createHeading5(String textContent)
Creates a<h5>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- an
<h5>
element.
-
createHeading6
static Element createHeading6(String textContent)
Creates a<h6>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- an
<h6>
element.
-
createHr
static Element createHr()
Creates an<hr>
element.- Returns:
- an
<hr>
element.
-
createInput
static Element createInput()
Creates an<input>
element.- Returns:
- an
<input>
element.
-
createInput
static Element createInput(String type)
Creates an<input>
element with the given type.- Parameters:
type
- the type attribute for the element- Returns:
- an
<input>
element
-
createLabel
static Element createLabel()
Creates an<label>
element.- Returns:
- an
<label>
element.
-
createLabel
static Element createLabel(String textContent)
Creates an<label>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- an
<label>
element.
-
createListItem
static Element createListItem()
Creates an<li>
element.- Returns:
- an
<li>
element.
-
createListItem
static Element createListItem(String textContent)
Creates an<li>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- an
<li>
element.
-
createOption
static Element createOption()
Creates an<option>
element.- Returns:
- an
<option>
element.
-
createOption
static Element createOption(String textContent)
Creates an<option>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- an
<option>
element.
-
createParagraph
static Element createParagraph()
Creates a<p>
element.- Returns:
- a
<p>
element.
-
createParagraph
static Element createParagraph(String textContent)
Creates a<p>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- a
<p>
element.
-
createPreformatted
static Element createPreformatted()
Creates a<pre>
element.- Returns:
- a
<pre>
element.
-
createPreformatted
static Element createPreformatted(String textContent)
Creates a<pre>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- a
<pre>
element.
-
createSelect
static Element createSelect()
Creates a<select>
element.- Returns:
- a
<select>
element.
-
createSpan
static Element createSpan()
Creates a<span>
element.- Returns:
- a
<span>
element.
-
createSpan
static Element createSpan(String textContent)
Creates a<span>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- a
<span>
element.
-
createTextarea
static Element createTextarea()
Creates a<textarea>
element.- Returns:
- a
<textarea>
element.
-
createUnorderedList
static Element createUnorderedList()
Creates a<ul>
element.- Returns:
- a
<ul>
element.
-
createStrong
static Element createStrong()
Creates a<strong>
element.- Returns:
- a
<strong>
element.
-
createStrong
static Element createStrong(String textContent)
Creates a<strong>
element with the given text content.- Parameters:
textContent
- the text content of the element- Returns:
- a
<strong>
element
-
createEmphasis
static Element createEmphasis()
Creates an<em>
element.- Returns:
- an
<em>
element.
-
-