本文整理了Java中com.vaadin.flow.dom.Element.createText()
方法的一些代码示例,展示了Element.createText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.createText()
方法的具体详情如下:
包路径:com.vaadin.flow.dom.Element
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!