本文整理匯總了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);
}
}