本文整理汇总了Java中com.google.gwt.user.client.ui.HTML.setText方法的典型用法代码示例。如果您正苦于以下问题:Java HTML.setText方法的具体用法?Java HTML.setText怎么用?Java HTML.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.HTML
的用法示例。
在下文中一共展示了HTML.setText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: outputEditorState
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* Output content for and editor
*/
private void outputEditorState(final Editor editor,
final HTML prettyContent, final HTML prettyHtml) {
Runnable printer = new Runnable() {
public void run() {
if (!quiet) {
String content = EditorDocFormatter.formatContentDomString(editor);
String html = EditorDocFormatter.formatImplDomString(editor);
if (content != null) {
prettyContent.setText(content);
}
if (html != null) {
prettyHtml.setText(html);
}
}
}
};
if (LogLevel.showDebug()) {
// Flush and update once it's safe
if (editor.getContent().flush(printer)) {
printer.run(); // note that if true is returned, the command isn't run inside flush.
}
}
}
示例2: onRender
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
HTML html = new HTML();
// Hosted mode don't support applet loading....
if (GWT.isScript()) {
html.setHTML(getAppletTag());
} else {
html.setText(getAppletTag());
}
add(html);
layout();
}
示例3: onRender
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
HTML html = new HTML();
html.setText(getInfo());
add(html);
layout();
}
示例4: setMessageToHtml
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public static void setMessageToHtml(String message, ContentMode contentMode, HTML widget) {
if(contentMode == ContentMode.HTML) {
widget.setHTML(message);
} else if(contentMode == ContentMode.PREFORMATTED) {
PreElement preElement = Document.get().createPreElement();
preElement.setInnerText(message);
widget.setHTML(preElement.getString());
} else {
widget.setText(message);
}
}