Example usage for com.google.gwt.dom.client Element getPropertyObject

List of usage examples for com.google.gwt.dom.client Element getPropertyObject

Introduction

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

Prototype

@Override
    public Object getPropertyObject(String name) 

Source Link

Usage

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

License:Apache License

/**
 * @param element//from  w  w w .  ja v a2s  .c o  m
 * @return The annotation type of the given element, or null if it is not
 *   an element managed by this instance
 */
public DiffType getDiffType(Element element) {
    return element == null || NodeManager.getTransparentManager(element) != this ? null
            : (DiffType) element.getPropertyObject(DIFF_KEY);
}

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

License:Apache License

/**
 * {@inheritDoc}//from  ww  w .  ja  va 2s. c om
 */
public Element needToSplit(Element transparentNode) {
    DiffType type = (DiffType) transparentNode.getPropertyObject(DIFF_KEY);
    if (type == null) {
        throw new IllegalArgumentException("No diff type known for given node");
    }

    return createElement(type);
}

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

License:Apache License

/**
 * NOTE(danilatos): This is preliminary/*from   w  w w.java  2s .  c  om*/
 * @param element Element
 * @return True if it is an intentional transparent node
 */
public static boolean isTransparent(Element element) {
    return element.getPropertyObject(TRANSPARENCY) != null;
}

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

License:Apache License

/**
 * @param element//from   ww w  .j  av  a 2s . co  m
 * @return the transparency level of the given element, or null if it is not
 *   a transparent node
 */
public static Skip getTransparency(Element element) {
    return (Skip) element.getPropertyObject(TRANSPARENCY);
}

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

License:Apache License

/**
 * @param element/*from ww  w .  j  a  v  a 2  s .  c o m*/
 * @return The transparent node manager for the given element, or null if
 *   none.
 */
@SuppressWarnings("unchecked")
public static TransparentManager<Element> getTransparentManager(Element element) {
    return (TransparentManager<Element>) element.getPropertyObject(TRANSPARENT_BACKREF);
}

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

License:Apache License

/**
 * @param nodelet Gets the ContentElement reference stored in this node.
 * @return null if no back reference./* w ww . j  a  v a 2s .  c  om*/
 */
public static ContentElement getBackReference(Element nodelet) {
    return nodelet == null ? null : (ContentElement) nodelet.getPropertyObject(BACKREF_NAME);
}

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

License:Apache License

/**
 * Check if an element has a back reference. No smartness or searching upwards.
 * @param nodelet// w w  w. j a va 2 s.  c o  m
 * @return true if the given element has a back reference
 */
public static boolean hasBackReference(Element nodelet) {
    return nodelet == null ? false : nodelet.getPropertyObject(BACKREF_NAME) != null;
}

From source file:org.waveprotocol.wave.client.editor.webdriver.EditorWebDriverUtil.java

License:Apache License

/**
 * @param editorDiv//from ww w  .j av  a 2  s  . co m
 * @return Editor owning given doc div
 */
private static Editor getByEditorDiv(Element editorDiv) {
    return (editorDiv == null) ? null : (Editor) editorDiv.getPropertyObject(EDITOR_WEBDRIVER_PROPERTY);
}

From source file:org.waveprotocol.wave.client.wavepanel.view.dom.BlipMetaDomImpl.java

License:Apache License

public StringSequence getInlineLocators() {
    if (inlineLocators == null) {
        Element content = getContentContainer().getFirstChildElement();
        if (content != null) {
            inlineLocators = (StringSequence) content.getPropertyObject(INLINE_LOCATOR_PROPERTY);
            if (inlineLocators == null) {
                // Note: getAttribute() of a missing attribute does not return null on
                // all browsers.
                if (content.hasAttribute(INLINE_LOCATOR_ATTRIBUTE)) {
                    String serial = content.getAttribute(INLINE_LOCATOR_ATTRIBUTE);
                    inlineLocators = StringSequence.create(serial);
                } else {
                    inlineLocators = StringSequence.create();
                }//  w w  w. j  a  v a  2 s .  c  o  m
                content.setPropertyObject(INLINE_LOCATOR_PROPERTY, inlineLocators);
            }
        } else {
            // Leave inlineLocators as null, since the document is not here yet.
        }
    }
    return inlineLocators;
}