本文整理了Java中com.vaadin.ui.Label.getContentMode()
方法的一些代码示例,展示了Label.getContentMode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.getContentMode()
方法的具体详情如下:
包路径:com.vaadin.ui.Label
类名称:Label
方法名:getContentMode
[英]Gets the content mode of the label.
[中]获取标签的内容模式。
代码示例来源:origin: com.vaadin/vaadin-server
@Override
public void writeDesign(Element design, DesignContext designContext) {
super.writeDesign(design, designContext);
String content = getValue();
if (content != null) {
switch (getContentMode()) {
case TEXT:
case PREFORMATTED: {
// FIXME This attribute is not enough to be able to restore the
// content mode in readDesign. The content mode should instead
// be written directly in the attribute and restored in
// readDesign. See ticket #19435
design.attr(DESIGN_ATTR_PLAIN_TEXT, true);
String encodeForTextNode = DesignFormatter
.encodeForTextNode(content);
if (encodeForTextNode != null) {
design.html(encodeForTextNode);
}
}
break;
case HTML:
design.html(content);
break;
}
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web
@Override
public boolean isHtmlEnabled() {
return component.getContentMode() == ContentMode.HTML;
}
内容来源于网络,如有侵权,请联系作者删除!