com.vaadin.flow.dom.Element.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中com.vaadin.flow.dom.Element.<init>()方法的一些代码示例,展示了Element.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.<init>()方法的具体详情如下:
包路径:com.vaadin.flow.dom.Element
类名称:Element
方法名:<init>

Element.<init>介绍

[英]Private constructor for initializing with an existing node and state provider.
[中]用于使用现有节点和状态提供程序初始化的专用构造函数。

代码示例

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates a {@code &lt;div>} element.
 *
 * @return a {@code &lt;div>} element.
 */
static Element createDiv() {
  return new Element(Tag.DIV);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;li>} element.
 *
 * @return an {@code &lt;li>} element.
 */
static Element createListItem() {
  return new Element(Tag.LI);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;label>} element.
 *
 * @return an {@code &lt;label>} element.
 */
static Element createLabel() {
  return new Element(Tag.LABEL);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates a {@code &lt;select>} element.
 *
 * @return a {@code &lt;select>} element.
 */
static Element createSelect() {
  return new Element(Tag.SELECT);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates a {@code &lt;strong>} element.
 *
 * @return a {@code &lt;strong>} element.
 */
static Element createStrong() {
  return new Element(Tag.STRONG);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;h1>} element.
 *
 * @return an {@code &lt;h1>} element.
 */
static Element createHeading1() {
  return new Element(Tag.H1);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;h2>} element.
 *
 * @return an {@code &lt;h2>} element.
 */
static Element createHeading2() {
  return new Element(Tag.H2);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;h3>} element.
 *
 * @return an {@code &lt;h3>} element.
 */
static Element createHeading3() {
  return new Element(Tag.H3);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;h5>} element.
 *
 * @return an {@code &lt;h5>} element.
 */
static Element createHeading5() {
  return new Element(Tag.H5);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates a {@code &lt;ul>} element.
 *
 * @return a {@code &lt;ul>} element.
 */
static Element createUnorderedList() {
  return new Element(Tag.UL);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;em>} element.
 *
 * @return an {@code &lt;em>} element.
 */
static Element createEmphasis() {
  return new Element(Tag.EM);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;a>} element.
 *
 * @return an {@code &lt;a>} element.
 */
static Element createAnchor() {
  return new Element(Tag.A);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;h4>} element.
 *
 * @return an {@code &lt;h4>} element.
 */
static Element createHeading4() {
  return new Element(Tag.H4);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;h6>} element.
 *
 * @return an {@code &lt;h6>} element.
 */
static Element createHeading6() {
  return new Element(Tag.H6);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates an {@code &lt;input>} element.
 *
 * @return an {@code &lt;input>} element.
 */
static Element createInput() {
  return new Element(Tag.INPUT);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates a {@code &lt;p>} element.
 *
 * @return a {@code &lt;p>} element.
 */
static Element createParagraph() {
  return new Element(Tag.P);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates a {@code &lt;pre>} element.
 *
 * @return a {@code &lt;pre>} element.
 */
static Element createPreformatted() {
  return new Element(Tag.PRE);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates a {@code &lt;span>} element.
 *
 * @return a {@code &lt;span>} element.
 */
static Element createSpan() {
  return new Element(Tag.SPAN);
}

代码示例来源:origin: com.vaadin/flow-server

/**
 * Creates a {@code &lt;p>} element with the given text content.
 *
 * @param textContent
 *            the text content of the element
 * @return a {@code &lt;p>} element.
 */
static Element createParagraph(String textContent) {
  return new Element(Tag.P).setText(textContent);
}

代码示例来源:origin: com.vaadin/flow-component-demo-helpers

private void addSourceCodeBlock(String text, String className) {
    Element pre = new Element("pre");
    Element code = new Element("code");
    pre.appendChild(code);
    code.setAttribute("spellcheck", "false");
    code.getClassList().add(className);
    code.setText(text);
    getElement().appendChild(pre);
  }
}

相关文章

微信公众号

最新文章

更多