Interface ElementFactory


public interface ElementFactory
Helpers to create Element instances.
Since:
1.0
Author:
Vaadin Ltd
  • Method Details

    • createAnchor

      static Element createAnchor()
      Creates an <a> element.
      Returns:
      an <a> element.
    • createAnchor

      static Element createAnchor(String href)
      Creates an <a> with the given href 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 given href attribute and text content.
      Parameters:
      href - the href parameter for the element
      textContent - the text content of the element
      Returns:
      an <a> element.
    • createRouterLink

      static Element createRouterLink(String href, String textContent)
      Creates an <a> element with the given href 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 element
      textContent - 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.
    • createEmphasis

      static Element createEmphasis(String textContent)
      Creates an <em> element with the given text content.
      Parameters:
      textContent - the text content of the element
      Returns:
      an <em> element.