Example usage for com.google.gwt.dom.builder.client DomBuilderFactory get

List of usage examples for com.google.gwt.dom.builder.client DomBuilderFactory get

Introduction

In this page you can find the example usage for com.google.gwt.dom.builder.client DomBuilderFactory get.

Prototype

public static DomBuilderFactory get() 

Source Link

Document

Get the instance of the DomBuilderFactory .

Usage

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

License:Apache License

@Override
public Element resolvePotentialElement() {
    String realText = text;//from  ww w.  jav a2 s.  c  o  m
    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;//  ww w .j av  a  2 s  . com
        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;
    }
}