Example usage for com.google.gwt.dom.client SpanElement setPropertyObject

List of usage examples for com.google.gwt.dom.client SpanElement setPropertyObject

Introduction

In this page you can find the example usage for com.google.gwt.dom.client SpanElement setPropertyObject.

Prototype

@Override
    public void setPropertyObject(String name, Object value) 

Source Link

Usage

From source file:org.waveprotocol.wave.client.editor.impl.DiffManager.java

License:Apache License

/**
 * Create a diff annotation element/* w w  w.  j  a va 2  s  .  co  m*/
 * @param type The type of change it will be annotating
 * @return The newly created element
 */
public Element createElement(DiffType type) {
    SpanElement element = Document.get().createSpanElement();
    element.setPropertyObject(DIFF_KEY, type);
    NodeManager.setTransparentBackref(element, this);

    // HACK(danilatos): Demo looms, no time for learning how to use resource bundle etc.
    // or adding accessors to stylebase
    switch (type) {
    case INSERT:
        NodeManager.setTransparency(element, Skip.SHALLOW);
        break;
    case DELETE:
        NodeManager.setTransparency(element, Skip.DEEP);
        break;
    }

    styleElement(element, type);

    elements.add(element);

    return element;
}