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

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

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

Element.createText介绍

[英]Creates a text node with the given text.
[中]使用给定文本创建文本节点。

代码示例

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

/**
 * Creates an instance using the given text.
 *
 * @param text
 *            the text to show
 */
public Text(String text) {
  super(Element.createText(text));
}

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

IconComponent(String text) {
    super(Element.createText(text));
  }
}

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

private void reportException(Exception exception, String path,
    String exceptionText) {
  getElement().appendChild(Element.createText(exceptionText));
  VaadinService vaadinService = VaadinService.getCurrent();
  // Check that we have a vaadinService as else we will fail on a NPE and
  // the stacktrace we actually got will disappear and getting a NPE is
  // confusing.
  boolean productionMode = vaadinService != null && vaadinService
      .getDeploymentConfiguration().isProductionMode();
  if (!productionMode) {
    checkLogBinding();
    printStacktrace(exception);
  }
  getLogger().error(
      "There was an exception while trying to navigate to '{}'", path,
      exception);
}

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

private void setTextContent(String textContent) {
  Element child;
  if (getChildCount() == 1 && getChild(0).isTextNode()) {
    child = getChild(0).setText(textContent);
  } else {
    child = createText(textContent);
  }
  removeAllChildren();
  appendChild(child);
}

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

span.setText(text);
} else if (iconComponent == null) {
  getElement().appendChild(Element.createText(text));
} else {
  span = ElementFactory.createSpan(text);

相关文章

微信公众号

最新文章

更多