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

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

Introduction

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

Prototype

@Override
    public void setInnerText(String text) 

Source Link

Usage

From source file:info.magnolia.ui.vaadin.gwt.client.magnoliashell.shellmessage.VDetailedShellMessage.java

License:Open Source License

@Override
protected void construct() {
    super.construct();
    Element detailMessageElement = DOM.createDiv();
    detailMessageElement.addClassName("v-shell-message-detail");
    detailMessageElement.setInnerText(getMessage());
    detailsEl.appendChild(detailMessageElement);
    getElement().appendChild(detailsEl);
}

From source file:info.magnolia.ui.vaadin.gwt.client.magnoliashell.viewport.widget.AppPreloader.java

License:Open Source License

public AppPreloader() {
    super();/* w  ww  .  j  a v  a  2s  .  c o m*/
    setElement(root);
    setStyleName("v-app-preloader v-viewport v-shell-tabsheet app");

    navigator.addClassName("nav nav-tabs single-tab");
    tab.addClassName("clearfix active");
    tabCaption.setClassName("tab-title");

    tab.appendChild(tabCaption);
    navigator.appendChild(tab);
    root.appendChild(navigator);

    Element preloader = DOM.createDiv();
    preloader.addClassName("v-preloader");

    Element loading = DOM.createSpan();
    loading.addClassName("v-caption");
    loading.setInnerText("Loading");

    preloader.appendChild(new LoadingIconWidget().getElement());
    preloader.appendChild(DOM.createElement("br"));
    preloader.appendChild(loading);

    root.appendChild(preloader);
}

From source file:org.apache.solr.explorer.client.SolrExplorer.java

License:Apache License

private void setSplashMessage(String message) {
    Element splashText = DOM.getElementById("splashText");
    splashText.setInnerText(message);
}

From source file:org.apache.solr.explorer.client.util.ui.widget.UnorderedList.java

License:Apache License

public void addListItem(String text, boolean html) {
    Element li = DOM.createElement("LI");
    if (html) {//from w  w w  .  j  a  v  a2  s.com
        li.setInnerHTML(text);
    } else {
        li.setInnerText(text);
    }
    getElement().appendChild(li);
}

From source file:org.bonitasoft.forms.client.view.common.DOMUtils.java

License:Open Source License

/**
 * @param headNodes/*from   www .ja  va  2  s . c  om*/
 */
public void addHeaders(final List<HeadNode> headNodes) {
    final Element headElement = getHeadElement();
    if (headElement != null) {
        for (final HeadNode headNode : headNodes) {
            if (isHeadNodeUseful(headNode)) {
                if (!isContainHeadNode(headElement, headNode)) {
                    // removeOldHeaderElementIfPresent(headElement, headNode);
                    if (headNode.getTagName() == null) {
                        //for comment nodes
                        final Node textNode = Document.get().createTextNode(headNode.getInnerHtml());
                        headElement.appendChild(textNode);
                    } else {
                        //for other nodes
                        final Element headChildElement = DOM.createElement(headNode.getTagName());
                        for (final Entry<String, String> attributeEntry : headNode.getAttributes().entrySet()) {
                            headChildElement.setAttribute(attributeEntry.getKey(), attributeEntry.getValue());
                        }
                        if (headNode.getInnerHtml() != null && headNode.getInnerHtml().length() > 0) {
                            headChildElement.setInnerText(headNode.getInnerHtml());
                        }
                        headElement.appendChild(headChildElement);
                    }
                }
                if ("title".equalsIgnoreCase(headNode.getTagName())) {
                    Window.setTitle(headNode.getInnerHtml());
                }
            }
        }
    }
}

From source file:org.bonitasoft.forms.client.view.common.DOMUtils.java

License:Open Source License

/**
 * insert a content inside an element/*from w w w  .j  av a  2  s. c o  m*/
 *
 * @param htmlPanel
 * @param pageLabelElementId
 * @param pageLabel
 * @param allowHTML
 */
public void insertInElement(final HTMLPanel htmlPanel, final String elementId, final String content,
        final boolean preventHTML) {

    if (htmlPanel != null) {
        final HTML htmlContent = new HTML();
        if (preventHTML) {
            htmlContent.setText(content);
        } else {
            htmlContent.setHTML(content);
        }
        htmlPanel.add(htmlContent, elementId);
    } else {
        final Element element = DOM.getElementById(elementId);
        if (element != null) {
            if (preventHTML) {
                element.setInnerText(content);
            } else {
                element.setInnerHTML(content);
            }
        }
    }
}

From source file:org.bonitasoft.forms.client.view.common.DOMUtils.java

License:Open Source License

/**
 * To make script in scriptElements work , need to add script elements in the currentElement to parentElement
 *
 * @param currentElement//from   w  w  w.j ava2  s .  c  o  m
 * @param parentElement
 */
public void addScriptElementToDOM(final Element currentElement, final Element parentElement) {
    final List<Element> list = new ArrayList<Element>();
    final NodeList<com.google.gwt.dom.client.Element> scripts = currentElement.getElementsByTagName("script");
    for (int i = 0; i < scripts.getLength(); i++) {
        list.add((Element) scripts.getItem(i));
    }

    for (int i = 0; i < list.size(); i++) {
        final Element e = list.get(i);
        e.removeFromParent();
        final Element scriptElement = DOM.createElement("script");
        final String type = e.getAttribute("type");
        if (!isEmpty(type)) {
            scriptElement.setAttribute("type", type);
        }
        final String language = e.getAttribute("language");
        if (!isEmpty(language)) {
            scriptElement.setAttribute("language", language);
        }
        final String src = e.getAttribute("src");
        if (!isEmpty(src)) {
            scriptElement.setAttribute("src", src);
        }
        scriptElement.setInnerText(e.getInnerText());
        parentElement.appendChild(scriptElement);
    }
}

From source file:org.bonitasoft.web.toolkit.client.ui.component.CodeFormatter.java

License:Open Source License

/**
 * Generate the DOM Element corresponding to the current CodeFormatter.
 *//*from  w  ww. ja v  a  2 s  .  c o m*/
@Override
protected Element makeElement() {
    final Element pre = DOM.createElement("pre");
    final Element code = DOM.createElement("code");
    if (this.language != null) {
        code.addClassName(this.language);
    }

    code.setInnerText(this.code);
    pre.appendChild(code);
    return pre;
}

From source file:org.bonitasoft.web.toolkit.client.ui.component.form.entry.Fieldset.java

License:Open Source License

protected Element makeLabel() {
    final Element label = DOM.createElement("legend");
    label.setInnerText(this.label);
    return label;
}

From source file:org.bonitasoft.web.toolkit.client.ui.component.form.entry.FieldsetCheckbox.java

License:Open Source License

@Override
protected Element makeLabel() {
    final Element legend = DOM.createElement("legend");
    legend.setTitle(this.tooltip);

    final String uid = Document.get().createUniqueId();

    this.inputElement = createInput();
    this.inputElement.setId(uid);
    this.inputElement.setAttribute("value", this.value);

    if (this.checked) {
        this.inputElement.setAttribute("checked", "checked");
    }//  w  ww  .  j ava  2  s. co  m

    final Element label = DOM.createLabel();
    label.setInnerText(this.label);
    label.setAttribute("for", uid);

    legend.appendChild(this.inputElement);
    legend.appendChild(label);

    return legend;
}