Example usage for com.google.gwt.dom.builder.shared ElementBuilderBase finish

List of usage examples for com.google.gwt.dom.builder.shared ElementBuilderBase finish

Introduction

In this page you can find the example usage for com.google.gwt.dom.builder.shared ElementBuilderBase finish.

Prototype

Element finish();

Source Link

Document

Return the built DOM as an Element .

Usage

From source file:com.google.gwt.uibinder.test.client.SimpleRenderable.java

License:Apache License

@Override
public Element resolvePotentialElement() {
    String realText = text;//from w w w .j  a  v  a 2  s .c  om
    text = "[dom built]" + text;
    ElementBuilderBase<?> builder = build(DomBuilderFactory.get());
    text = realText;
    setElement(builder.finish());
    return getElement();
}

From source file:com.google.gwt.uibinder.test.client.SimpleRenderable.java

License:Apache License

private void updateElement() {
    if (domIsReal()) {
        String realText = text;//from   w  ww. j a  va  2  s .  c  o m
        text = "[updated]" + text;
        /*
         * Sleazey. If this is to get real, should split rendering into the outer
         * builder and the inner builder. Update can just call the inner builder.
         * But we'd still have to make a bunch of dom calls to tear down the old
         * guts, something like while (el.firstChild) {
         * el.removeChild(el.firstChild); }
         * 
         * Have to wonder if that actually would be any faster than rebuilding the
         * guts as string
         */
        ElementBuilderBase<?> builder = build(DomBuilderFactory.get());
        getElement().setInnerHTML(builder.finish().getInnerHTML());
        text = realText;
    }
}