/** * The name of this node, depending on its type. * @return name of this node */ public final String getNodeName() { return ot.getNodeName(); }
/** * The name of this node, depending on its type. * @return name of this node */ public final String getNodeName() { return ot.getNodeName(); }
public String getNodeName() { return node.getNodeName(); }
public String getNodeName() { return node.getNodeName(); }
@PatchMethod static String getNodeName(JavaScriptObject o) { try { Node node = o.cast(); return node.getNodeName(); } catch (ClassCastException e) { // TODO: remove this when cast() will be fine return ""; } }
@PatchMethod static String getNodeName(JavaScriptObject o) { try { Node node = o.cast(); return node.getNodeName(); } catch (ClassCastException e) { // TODO: remove this when cast() will be fine return ""; } }
/** * Return whether a node is detached to the DOM. * * Be careful : This method works only on node that should be inserted within the body node. */ public static boolean isDetached(Node n) { assert n != null; if ("html".equalsIgnoreCase(n.getNodeName())) { return false; } return !getOwnerDocument(n).getBody().isOrHasChild(n); }
private void getFirstOfTypePseudo(JsNodeArray previousMatch, boolean previousDir, JsNodeArray matchingElms) { Node previous; Node next; for (int n = 0, nlen = previousMatch.size(); n < nlen; n++) { next = previous = previousMatch.getNode(n); if (previousDir) { while (JsUtils.truth(next = SelectorEngine.getPreviousSibling(next)) && !JsUtils .eq(next.getNodeName(), previous.getNodeName())) { } } else { while (JsUtils.truth(next = SelectorEngine.getNextSibling(next)) && !JsUtils.eq(next.getNodeName(), previous.getNodeName())) { } } if (!JsUtils.truth(next)) { matchingElms.addNode(previous); } } }
public Element getHeaderElement() { int nbc = getElement().getChildCount(); for( int c = 0; c < nbc; c++ ) { Node node = getElement().getChild( c ); if( node.getNodeName().equalsIgnoreCase( "thead" ) ) return (com.google.gwt.dom.client.Element.as( node )); } return null; }
public Element getHeaderElement() { int nbc = getElement().getChildCount(); for( int c = 0; c < nbc; c++ ) { Node node = getElement().getChild( c ); if( node.getNodeName().equalsIgnoreCase( "thead" ) ) return (com.google.gwt.dom.client.Element.as( node )); } return null; }
@SuppressWarnings( "deprecation" ) @Override public com.google.gwt.user.client.Element getBodyElement() { int nbc = getElement().getChildCount(); for( int c = 0; c < nbc; c++ ) { Node node = getElement().getChild( c ); if( node.getNodeName().equalsIgnoreCase( "tbody" ) ) return node.<com.google.gwt.user.client.Element>cast(); } return null; }
@SuppressWarnings( "deprecation" ) @Override public com.google.gwt.user.client.Element getBodyElement() { int nbc = getElement().getChildCount(); for( int c = 0; c < nbc; c++ ) { Node node = getElement().getChild( c ); if( node.getNodeName().equalsIgnoreCase( "tbody" ) ) return node.<com.google.gwt.user.client.Element>cast(); } return null; }
for (int j = 0; j < nodes.getLength(); j++) { Node item = nodes.getItem(j); if ("thead".equalsIgnoreCase(item.getNodeName())) { //$NON-NLS-1$ this.thead = item.cast(); NodeList<Node> childNodes = this.thead.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node theadtr = childNodes.getItem(i); if ("tr".equalsIgnoreCase(theadtr.getNodeName())) { //$NON-NLS-1$ int thcount = 0; NodeList<Node> nodeList = theadtr.getChildNodes(); for (int k = 0; k < nodeList.getLength(); k++) { if ("th".equalsIgnoreCase(nodeList.getItem(k).getNodeName())) { //$NON-NLS-1$ thcount++; } else if ("tbody".equalsIgnoreCase(item.getNodeName())) { //$NON-NLS-1$ this.tbody = item.cast(); removeAllChildNodes(this.tbody);
private void getOnlyOfTypePseudo(JsNodeArray previousMatch, JsNodeArray matchingElms) { Node previous; Node next; Node prev; Node oParent = null; for (int o = 0, olen = previousMatch.size(); o < olen; o++) { prev = next = previous = previousMatch.getNode(o); Node prevParent = previous.getParentNode(); if (prevParent != oParent) { while (JsUtils.truth(prev = SelectorEngine.getPreviousSibling(prev)) && !JsUtils .eq(prev.getNodeName(), previous.getNodeName())) { } while (JsUtils.truth(next = SelectorEngine.getNextSibling(next)) && !JsUtils.eq(next.getNodeName(), previous.getNodeName())) { } if (!JsUtils.truth(prev) && !JsUtils.truth(next)) { matchingElms.addNode(previous); } oParent = prevParent; } } } }
private void addGroup(OptGroupElement group) { int position = parsed.size(); GroupItem item = new GroupItem(); item.arrayIndex = position; item.label = group.getLabel(); item.children = 0; item.disabled = group.isDisabled(); parsed.add(item); NodeList<Node> children = group.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node n = children.getItem(i); if ("OPTION".equalsIgnoreCase(n.getNodeName())) { addOption(OptionElement.as((Element) n), position, group.isDisabled()); } } }
private void addGroup(OptGroupElement group) { int position = parsed.size(); GroupItem item = new GroupItem(); item.arrayIndex = position; item.label = group.getLabel(); item.children = 0; item.disabled = group.isDisabled(); parsed.add(item); NodeList<Node> children = group.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node n = children.getItem(i); if ("OPTION".equalsIgnoreCase(n.getNodeName())) { addOption(OptionElement.as((Element) n), position, group.isDisabled()); } } }
protected String getElementTreeXpath(com.google.gwt.dom.client.Element element) { String result = ""; // Use nodeName (instead of localName) so namespace prefix is included (if any). for (; element != null && element.getNodeType() == 1; element = element.getParentElement()) { if (result.length() > 0) { result = "/" + result; } if (hasId(element)) { return getXPathForId(element) + result; } int index = 0; for (Node sibling = element.getPreviousSibling(); sibling != null; sibling = sibling.getPreviousSibling()) { // Ignore document type declaration. if (sibling.getNodeType() == Node.DOCUMENT_NODE) continue; if (sibling.getNodeName().equals(element.getNodeName())) { ++index; } } String tagName = element.getNodeName().toLowerCase(); String pathIndex = (index > 0 ? "[" + (index+1) + "]" : ""); result = tagName + pathIndex + result; } return result; }
private static void getGeneralSiblingNodes(JsNodeArray matchingElms, JsObjectArray<String> nextTag, JsRegexp nextRegExp, Node prevRef) { while (JsUtils.truth((prevRef = SelectorEngine.getNextSibling(prevRef))) && !isAdded(prevRef)) { if (!JsUtils.truth(nextTag) || nextRegExp .test(prevRef.getNodeName())) { setAdded(prevRef, true); matchingElms.addNode(prevRef); } } }
private static void getSiblingNodes(JsNodeArray matchingElms, JsObjectArray<String> nextTag, JsRegexp nextRegExp, Node prevRef) { while (JsUtils.truth(prevRef = SelectorEngine.getNextSibling(prevRef)) && prevRef.getNodeType() != Node.ELEMENT_NODE) { } if (JsUtils.truth(prevRef)) { if (!JsUtils.truth(nextTag) || nextRegExp .test(prevRef.getNodeName())) { matchingElms.addNode(prevRef); } } }
private void addGroup(OptGroupElement group) { int position = parsed.length(); GroupItem item = new GroupItem(); item.arrayIndex = position; item.label = group.getLabel(); item.children = 0; item.disabled = group.isDisabled(); parsed.add(item); NodeList<Node> children = group.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node n = children.getItem(i); if ("OPTION".equalsIgnoreCase(n.getNodeName())) { addOption(OptionElement.as((Element) n), position, group.isDisabled()); } } }