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

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

Introduction

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

Prototype

public static boolean is(JavascriptObjectEquivalent o) 

Source Link

Document

Determines whether the given JavaScriptObject can be cast to an Element .

Usage

From source file:com.extjs.gxt.ui.client.event.DomEvent.java

License:sencha.com license

/**
 * Returns <code>true</code> if the target of this event equals or is a child
 * of the given element.//from ww w.jav a  2s.c o m
 * 
 * @param element the element
 * @param toElement true to use {@link Event#getRelatedEventTarget()}
 * @return the within state
 */
public boolean within(Element element, boolean toElement) {
    if (event != null && Element.is(element)) {
        EventTarget target = toElement ? event.getRelatedEventTarget() : event.getEventTarget();
        if (Element.is(target)) {
            return DOM.isOrHasChild(element, (Element) Element.as(target));
        }
    }
    return false;
}

From source file:org.kaaproject.avro.ui.gwt.client.widget.FormPopup.java

License:Apache License

private boolean isCaptionEvent(NativeEvent event) {
    EventTarget target = event.getEventTarget();
    if (Element.is(target)) {
        com.google.gwt.dom.client.Element element = Element.as(target);
        if (decPanel.getElement().isOrHasChild(element)) {
            String tag = element.getTagName();
            String className = element.getClassName();
            if (tag.equalsIgnoreCase("tr")) {
                if ("top".equalsIgnoreCase(className)) {
                    return true;
                }/*from ww  w. j a  v a  2s.c  o  m*/
            } else if (tag.equalsIgnoreCase("td")) {
                if ("topLeft".equalsIgnoreCase(className) || "topCenter".equalsIgnoreCase(className)
                        || "topRight".equalsIgnoreCase(className)) {
                    return true;
                }
            } else if (tag.equalsIgnoreCase("div")) {
                if ("topLeftInner".equalsIgnoreCase(className) || "topCenterInner".equalsIgnoreCase(className)
                        || "topRightInner".equalsIgnoreCase(className)) {
                    return true;
                }
            }
        }
    }
    return false;
}