Package com.vaadin.flow.dom
Interface ElementFactory
-
public interface ElementFactoryHelpers to createElementinstances.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Method Summary
Static Methods Modifier and Type Method Description static ElementcreateAnchor()Creates 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 ElementcreateButton()Creates a<button>element.static ElementcreateButton(String textContent)Creates a<button>with the given text content.static ElementcreateDiv()Creates a<div>element.static ElementcreateDiv(String textContent)Creates a<div>with the given text content.static ElementcreateEmphasis()Creates an<em>element.static ElementcreateEmphasis(String textContent)Creates an<em>element with the given text content.static ElementcreateHeading1()Creates an<h1>element.static ElementcreateHeading1(String textContent)Creates a<h1>element with the given text content.static ElementcreateHeading2()Creates an<h2>element.static ElementcreateHeading2(String textContent)Creates a<h2>element with the given text content.static ElementcreateHeading3()Creates an<h3>element.static ElementcreateHeading3(String textContent)Creates a<h3>element with the given text content.static ElementcreateHeading4()Creates an<h4>element.static ElementcreateHeading4(String textContent)Creates a<h4>element with the given text content.static ElementcreateHeading5()Creates an<h5>element.static ElementcreateHeading5(String textContent)Creates a<h5>element with the given text content.static ElementcreateHeading6()Creates an<h6>element.static ElementcreateHeading6(String textContent)Creates a<h6>element with the given text content.static ElementcreateHr()Creates an<hr>element.static ElementcreateInput()Creates an<input>element.static ElementcreateInput(String type)Creates an<input>element with the given type.static ElementcreateLabel()Creates an<label>element.static ElementcreateLabel(String textContent)Creates an<label>element with the given text content.static ElementcreateListItem()Creates an<li>element.static ElementcreateListItem(String textContent)Creates an<li>element with the given text content.static ElementcreateOption()Creates an<option>element.static ElementcreateOption(String textContent)Creates an<option>element with the given text content.static ElementcreateParagraph()Creates a<p>element.static ElementcreateParagraph(String textContent)Creates a<p>element with the given text content.static ElementcreatePreformatted()Creates 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 ElementcreateSelect()Creates a<select>element.static ElementcreateSpan()Creates a<span>element.static ElementcreateSpan(String textContent)Creates a<span>element with the given text content.static ElementcreateStrong()Creates a<strong>element.static ElementcreateStrong(String textContent)Creates a<strong>element with the given text content.static ElementcreateTextarea()Creates a<textarea>element.static ElementcreateUnorderedList()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 givenhrefattribute.- 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 givenhrefattribute 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 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
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.
-
-