本文整理了Java中com.google.gwt.dom.client.Element.setInnerText()
方法的一些代码示例,展示了Element.setInnerText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.setInnerText()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:setInnerText
[英]The text between the start and end tags of the object.
[中]对象的开始标记和结束标记之间的文本。
代码示例来源:origin: com.google.gwt/gwt-servlet
public final void setText(String text) {
labelTD.setInnerText(text);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the text contained within an element. If the element already has
* children, they will be destroyed.
*
* @param elem the element whose inner text is to be set
* @param text the new text
* @deprecated Use {@link Element#setInnerText(String)} instead.
*/
@Deprecated
public static void setInnerText(Element elem, String text) {
elem.setInnerText(text);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void setText(String text) {
setWidget(null);
contentElem.setInnerText(text);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public final void setText(String text) {
if (beforeInitPlaceholder == null) {
setTextImpl(text);
} else {
beforeInitPlaceholder.setInnerText(text);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void doTextImpl(String text) {
getCurrentElement().setInnerText(text);
}
代码示例来源:origin: kaaproject/kaa
definedStyles + "; vertical-align:middle;");
Element textElement = DOM.createElement("span");
textElement.setInnerText(text + " ");
DOM.insertChild(getElement(), textElement, 0);
Element caretSpan = DOM.createElement("span");
代码示例来源:origin: com.google.gwt/gwt-servlet
private void setInnerTextOrHtml(@IsSafeHtml String content, boolean isHtml) {
if (isHtml) {
element.setInnerHTML(content);
} else {
element.setInnerText(content);
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the text within the specified cell.
*
* @param row the cell's row
* @param column cell's column
* @param text the cell's text contents
* @throws IndexOutOfBoundsException
*/
public void setText(int row, int column, String text) {
prepareCell(row, column);
Element td;
td = cleanCell(row, column, text == null);
if (text != null) {
td.setInnerText(text);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the face's contents as text.
*
* @param text text to set as face's contents
*/
@Override
public final void setText(String text) {
face = DOM.createDiv();
UIObject.setStyleName(face, STYLENAME_HTML_FACE, true);
face.setInnerText(text);
updateButtonFace();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void setCaption(
FieldSetElement fieldset, Element legend, @IsSafeHtml String caption, boolean asHTML) {
// TODO(bruce): rewrite to be inlinable
assert (caption != null);
if (asHTML) {
legend.setInnerHTML(caption);
} else {
legend.setInnerText(caption);
}
if (!"".equals(caption)) {
// This is formulated to become an append (if there's no widget), an
// insertion at index 0 (if there is a widget but no legend already), or
// a no-op (if the legend is already in place).
fieldset.insertBefore(legend, fieldset.getFirstChild());
} else if (legend.getParentNode() != null) {
// We remove the legend from the DOM because leaving it in with an empty
// string renders as an ugly gap in the top border on some browsers.
fieldset.removeChild(legend);
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the text associated with a child by its index.
*
* @param index the index of the child whose text is to be set
* @param text the text to be associated with it
* @param asHTML <code>true</code> to treat the specified text as HTML
*/
public void setStackText(int index, @IsSafeHtml String text, boolean asHTML) {
if (index >= getWidgetCount()) {
return;
}
Element tdWrapper = DOM.getChild(DOM.getChild(body, index * 2), 0);
Element headerElem = DOM.getFirstChild(tdWrapper);
if (asHTML) {
getHeaderTextElem(headerElem).setInnerHTML(text);
} else {
getHeaderTextElem(headerElem).setInnerText(text);
}
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-ala-ui-client
@Override
public void clear() {
removeAllChildren(providersListGroup);
providerItems.clear();
selected = null;
providerType.setInnerText("");
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public void setText(String text) {
setWidget(null);
contentElem.setInnerText(text);
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public final void setText(String text) {
if (beforeInitPlaceholder == null) {
setTextImpl(text);
} else {
beforeInitPlaceholder.setInnerText(text);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
void setStopped() {
state.setAttribute("rel", "stopped");
state.setInnerText("STOPPED");
for (Installer installer : installers.values()) {
installer.setStopped();
}
}
代码示例来源:origin: org.kuali.student.core/ks-common-ui
public static SectionTitle generateH2Title(String titletext) {
Element headerElement = DOM.createElement("H2");
headerElement.setInnerText(titletext);
return generateTitle(headerElement, "KS-H2-Section-Title");
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Ensure that the content container exists and return it.
*
* @return the content container
*/
Element ensureContentContainer() {
if (contentContainer == null) {
contentContainer = Document.get().createDivElement();
ensureAnimationFrame().appendChild(contentContainer);
emptyMessageElem = Document.get().createDivElement();
emptyMessageElem.setInnerText(messages.emptyTree());
setStyleName(emptyMessageElem, tree.getStyle().cellTreeEmptyMessage(), true);
showOrHide(emptyMessageElem, false);
contentContainer.appendChild(emptyMessageElem);
showMoreElem = Document.get().createAnchorElement();
// CellTree prevents strict-CSP violation by cancelling event default action.
showMoreElem.setHref("javascript:;");
showMoreElem.setInnerText(messages.showMore());
setStyleName(showMoreElem, tree.getStyle().cellTreeShowMoreButton(), true);
showOrHide(showMoreElem, false);
contentContainer.appendChild(showMoreElem);
}
return contentContainer;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Recalculate the height and width of a native scrollbar.
*/
private static void maybeRecalculateNativeScrollbarSize() {
// Check if the size has already been calculated.
if (nativeHeight > -1) {
return;
}
// Create a scrollable element and attach it to the body.
Element scrollable = Document.get().createDivElement();
scrollable.getStyle().setPosition(Position.ABSOLUTE);
scrollable.getStyle().setTop(-1000.0, Unit.PX);
scrollable.getStyle().setLeft(-1000.0, Unit.PX);
scrollable.getStyle().setHeight(100.0, Unit.PX);
scrollable.getStyle().setWidth(100.0, Unit.PX);
scrollable.getStyle().setOverflow(Overflow.SCROLL);
scrollable.getStyle().setProperty("direction", "rtl");
Document.get().getBody().appendChild(scrollable);
// Add some content.
Element content = Document.get().createDivElement();
content.setInnerText("content");
scrollable.appendChild(content);
// Measure the height and width.
nativeHeight = scrollable.getOffsetHeight() - scrollable.getClientHeight();
nativeWidth = scrollable.getOffsetWidth() - scrollable.getClientWidth();
nativeRtl = (content.getAbsoluteLeft() > scrollable.getAbsoluteLeft());
// Detach the scrollable element.
scrollable.removeFromParent();
}
代码示例来源:origin: fr.putnami.pwt/pwt
@Override
public void setTitle(String title) {
Element titleElement = Document.get().createElement("h3");
this.container.appendChild(titleElement);
StyleUtils.addStyle(titleElement, Popover.STYLE_TITLE);
titleElement.setInnerText(title);
}
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-debugger-ide
@Override
public void renderElement(Element element, DebugConfiguration data) {
UIObject.ensureDebugId(element, "debug-configuration-type-" + data.getType().getId());
element.addClassName(editConfigurationsResources.getCss().categorySubElementHeader());
element.setInnerText(data.getName().trim().isEmpty() ? "<none>" : data.getName());
element.appendChild(renderSubElementButtons());
}
内容来源于网络,如有侵权,请联系作者删除!