本文整理匯總了Java中com.google.gwt.dom.client.Node.ELEMENT_NODE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Node.ELEMENT_NODE屬性的具體用法?Java Node.ELEMENT_NODE怎麽用?Java Node.ELEMENT_NODE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.gwt.dom.client.Node
的用法示例。
在下文中一共展示了Node.ELEMENT_NODE屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleDOMMutation
/**
* Handles DOM mutation events.
* @param event
* @param contentRange last known selection
*/
public void handleDOMMutation(SignalEvent event, ContentRange contentRange) {
// Early exit if non-safari or non-mac
if (!(UserAgent.isSafari() && UserAgent.isMac())) {
return;
}
// We don't care about DOMMutations that we generate while we are reverting.
if (isReverting) {
return;
}
previousContentRange = contentRange;
Node n = event.getTarget();
if (n.getNodeType() == Node.ELEMENT_NODE) {
Element e = Element.as(event.getTarget());
if (DOM_EVENTS_IGNORE.contains(event.getType())) {
// ignore
} else if (event.getType().equals(JsEvents.DOM_NODE_INSERTED) && handleDOMNodeInserted(e)) {
} else if (event.getType().equals(JsEvents.DOM_NODE_REMOVED) && handleDOMNodeRemoved(e)) {
}
}
}
示例2: dispatch
/**
* Dispatches an event through this handler collection.
*
* @param event event to dispatch
* @param target target element of the event
* @return true if a handled, false otherwise.
*/
boolean dispatch(E event, Element target) {
while (target != null) {
if (target.getNodeType() == Node.ELEMENT_NODE &&
target.hasAttribute(BuilderHelper.KIND_ATTRIBUTE)) {
W handler = waveHandlers.get(target.getAttribute(BuilderHelper.KIND_ATTRIBUTE));
if (handler != null) {
if (dispatch(event, target, handler)) {
return true;
}
}
}
target = !target.equals(top) ? target.getParentElement() : null;
}
return dispatchGlobal(event);
}
示例3: collectAllChildrenStyles
private List<Style> collectAllChildrenStyles(NodeList<Node> childNodes) {
List<Style> allStyles = Lists.newArrayList();
for (int x = 0; x < childNodes.getLength(); ++x) {
Node item = childNodes.getItem(x);
if (item.getNodeType() == Node.ELEMENT_NODE) {
Style styles = cssHelper.getComputedStyle(item);
allStyles.add(styles);
allStyles.addAll(collectAllChildrenStyles(((com.google.gwt.dom.client.Element) item).getChildNodes()));
}
}
return allStyles;
}
示例4: isElement
/**
* @return true if it is an element
*/
public static boolean isElement(Node n) {
return n.getNodeType() == Node.ELEMENT_NODE;
}
示例5: asElement
/** {@inheritDoc} */
@Override
public Element asElement(Node node) {
return node.getNodeType() == Node.ELEMENT_NODE ? node.<Element>cast() : null;
}