Example usage for com.google.gwt.user.client DOM setInnerText

List of usage examples for com.google.gwt.user.client DOM setInnerText

Introduction

In this page you can find the example usage for com.google.gwt.user.client DOM setInnerText.

Prototype

@Deprecated
public static void setInnerText(Element elem, String text) 

Source Link

Document

Sets the text contained within an element.

Usage

From source file:asquare.gwt.sb.client.fw.ModelElementFormatterDefault.java

License:Apache License

public void formatCell(Element viewElement, Object modelElement, Properties properties) {
    DOM.setAttribute(viewElement, "className", buildStyleName(properties));
    String newText = String.valueOf(modelElement);
    if (!DOM.getInnerText(viewElement).equals(newText)) {
        DOM.setInnerText(viewElement, newText);
    }//from ww w .jav a  2 s .  c  om
}

From source file:asquare.gwt.sb.client.ui.StreamPanel.java

License:Apache License

public void text(String text) {
    Element e = m_elementTreePath.peek();
    DOM.setInnerText(e, DOM.getInnerText(e) + text);
}

From source file:asquare.gwt.sb.client.widget.CTabBar.java

License:Apache License

private void addSpacers() {
    Element first = insertCellStructure(0);
    DOM.setAttribute(first, "className", "preSpacer");
    DOM.setInnerText(first, " "); // force cell to show in IE/Opera quirks mode

    Element last = insertCellStructure(super.getSize());
    DOM.setAttribute(last, "className", "postSpacer");
    DOM.setInnerText(last, " "); // force cell to show in IE/Opera quirks mode
}

From source file:asquare.gwt.sb.client.widget.TabBarView.java

License:Apache License

private void addSpacers() {
    Element first = insertCellStructure(0);
    DOM.setElementProperty(first, "className", "preSpacer");
    DOM.setInnerText(first, " "); // force cell to show in IE/Opera quirks mode

    Element last = insertCellStructure(super.getSize());
    DOM.setElementProperty(last, "className", "postSpacer");
    DOM.setInnerText(last, " "); // force cell to show in IE/Opera quirks mode
}

From source file:asquare.gwt.tk.client.ui.AlertDialog.java

License:Apache License

/**
 * Factory method which creates the caption. Called just before the dialog is
 * shown. /*from  w ww.j a va 2  s.  c  om*/
 * 
 * @return the caption, or <code>null</code>
 */
protected Widget buildCaption() {
    ColumnPanel captionPanel = new ColumnPanel();
    captionPanel.setWidth("100%"); // necessary so that descendent TD can have 100% width in Opera
    captionPanel.addCell();
    captionPanel.setCellStyleName("tk-AlertDialog-captionLeft");
    captionPanel.addCell();
    captionPanel.setCellStyleName("tk-AlertDialog-captionCenter");
    captionPanel.addCell();
    captionPanel.setCellStyleName("tk-AlertDialog-captionRight");

    if (m_captionIcon != null) {
        captionPanel.addWidgetTo(m_captionIcon, 0);
    }

    if (m_captionText != null) {
        if (m_captionTextAsHtml) {
            DOM.setInnerHTML(captionPanel.getCellElement(1), m_captionText);
        } else {
            DOM.setInnerText(captionPanel.getCellElement(1), m_captionText);
        }
    }

    return captionPanel;
}

From source file:asquare.gwt.tk.client.ui.ExternalHyperLink.java

License:Apache License

public void setText(String text) {
    DOM.setInnerText(getElement(), text);
}

From source file:asquare.gwt.tk.client.ui.ModalDialog.java

License:Apache License

/**
 * Sets the contents of the caption to the specified text, clearing any
 * previous contents from the caption.//from   www .j  av a  2 s  . c om
 * 
 * @param text the caption text
 * @param asHtml true to treat <code>text</code> as html
 * @see #setCaption(Widget)
 */
public void setCaption(String text, boolean asHtml) {
    if (m_caption != null) {
        clearCaption();
    }
    createCaption();
    if (asHtml) {
        DOM.setInnerHTML(m_panel.getCellElement(0), text);
    } else {
        DOM.setInnerText(m_panel.getCellElement(0), text);
    }
}

From source file:cc.alcina.framework.gwt.client.widget.DivStackPanel.java

License:Apache License

/**
 * Sets the text associated with a child by its index.
 * /*from  w w  w  .j a  v a 2  s . c  o  m*/
 * @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, String text, boolean asHTML) {
    if (index >= getWidgetCount()) {
        return;
    }
    Element tdWrapper = DOM.getChild(body, index * 2);
    Element headerElem = tdWrapper;
    rowTexts.put(index, new StackTextRow(text, asHTML));
    if (asHTML) {
        DOM.setInnerHTML(getHeaderTextElem(headerElem), text);
    } else {
        DOM.setInnerText(getHeaderTextElem(headerElem), text);
    }
}

From source file:cc.alcina.framework.gwt.client.widget.StyledAWidget.java

License:Apache License

@Override
public void setText(String text) {
    DOM.setInnerText(spanElem, text);
}

From source file:ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.LinkRenderer.java

License:Apache License

/** renders a div with an inline anchor inside (hand cursor is on anchor - inline) */
public static String renderAsLinkWithAnchor(final String text, final String href,
        final boolean openInNewWindow) {
    final Element anchor = DOM.createAnchor();
    DOM.setInnerText(anchor, text);

    DOM.setElementProperty(anchor, "href", href);
    if (openInNewWindow) {
        DOM.setElementProperty(anchor, "target", "blank");
    }//w  ww.ja v a 2 s .c  om
    return DOM.toString(anchor);
}