com.google.gwt.dom.client.Element.getChildNodes()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(290)

本文整理了Java中com.google.gwt.dom.client.Element.getChildNodes()方法的一些代码示例,展示了Element.getChildNodes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getChildNodes()方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getChildNodes

Element.getChildNodes介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. private void updateVisibility(Element container) {
  2. // If this element has an associated layer, re-run layout for it.
  3. Layer layer = getLayer(container);
  4. if (layer != null) {
  5. layout(layer);
  6. }
  7. // Walk all children, looking for elements with a '__layer' property. If one
  8. // exists, call layout() for that element. This is not cheap, but it's the
  9. // only way to correctly ensure that layout units get translated correctly.
  10. NodeList<Node> nodes = container.getChildNodes();
  11. for (int i = 0; i < nodes.getLength(); ++i) {
  12. Node node = nodes.getItem(i);
  13. if (node.getNodeType() == Node.ELEMENT_NODE) {
  14. updateVisibility(node.<Element>cast());
  15. }
  16. }
  17. }
  18. }

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static Element getChild(DOMImpl domImpl, Element userElem, int index) {
  3. if (index >= userElem.getChildNodes().getLength()) {
  4. return null;
  5. }
  6. return userElem.getChildNodes().getItem(index).cast();
  7. }

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static int getChildIndex(DOMImpl domImpl, Element parent, Element child) {
  3. if (parent == null || child == null) {
  4. return -1;
  5. }
  6. for (int i = 0; i < parent.getChildNodes().getLength(); i++) {
  7. if (child.equals(parent.getChildNodes().getItem(i))) {
  8. return i;
  9. }
  10. }
  11. return -1;
  12. }

代码示例来源:origin: gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static Element getChild(DOMImpl domImpl, Element userElem, int index) {
  3. if (index >= userElem.getChildNodes().getLength()) {
  4. return null;
  5. }
  6. return userElem.getChildNodes().getItem(index).cast();
  7. }

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static int getDOMRowCount(HTMLTable table, Element element) {
  3. return element.getChildNodes().getLength();
  4. }

代码示例来源:origin: gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static int getChildIndex(DOMImpl domImpl, Element parent, Element child) {
  3. if (parent == null || child == null) {
  4. return -1;
  5. }
  6. for (int i = 0; i < parent.getChildNodes().getLength(); i++) {
  7. if (child.equals(parent.getChildNodes().getItem(i))) {
  8. return i;
  9. }
  10. }
  11. return -1;
  12. }

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static int getDOMCellCount(HTMLTable table, Element element, int row) {
  3. return element.getChildNodes().getItem(row).getChildNodes().getLength();
  4. }

代码示例来源:origin: gwt-test-utils/gwt-test-utils

  1. private void handleRowCells(Grid wrapped, Element element) {
  2. int columnIndex = 0;
  3. NodeList<Node> childs = element.getChildNodes();
  4. for (int i = 0; i < childs.getLength(); i++) {
  5. Element e = childs.getItem(i).cast();
  6. if (CELL_TAG.equals(e.getTagName())) {
  7. handleCell(wrapped, e, columnIndex++);
  8. } else if (CUSTOMCELL_TAG.equals(e.getTagName())) {
  9. handleCustomCell(wrapped, e, UiBinderXmlUtils.getChildWidgets(e), columnIndex++);
  10. }
  11. }
  12. }

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. private void handleRowCells(Grid wrapped, Element element) {
  2. int columnIndex = 0;
  3. NodeList<Node> childs = element.getChildNodes();
  4. for (int i = 0; i < childs.getLength(); i++) {
  5. Element e = childs.getItem(i).cast();
  6. if (CELL_TAG.equals(e.getTagName())) {
  7. handleCell(wrapped, e, columnIndex++);
  8. } else if (CUSTOMCELL_TAG.equals(e.getTagName())) {
  9. handleCustomCell(wrapped, e, UiBinderXmlUtils.getChildWidgets(e), columnIndex++);
  10. }
  11. }
  12. }

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static Element getCellElement(CellFormatter cellFormatter, Element table, int row, int col) {
  3. TableRowElement rowElement = (TableRowElement) table.getChildNodes().getItem(row);
  4. return rowElement.getChildNodes().getItem(col).cast();
  5. }

代码示例来源:origin: gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static Element getFirstChildElement(Object domImpl, Element elem) {
  3. NodeList<Node> nodeList = elem.getChildNodes();
  4. for (int i = 0; i < nodeList.getLength(); i++) {
  5. Node node = nodeList.getItem(i);
  6. if (node.getNodeType() == Node.ELEMENT_NODE) {
  7. return node.cast();
  8. }
  9. }
  10. return null;
  11. }

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static Element getFirstChildElement(Object domImpl, Element elem) {
  3. NodeList<Node> nodeList = elem.getChildNodes();
  4. for (int i = 0; i < nodeList.getLength(); i++) {
  5. Node node = nodeList.getItem(i);
  6. if (node.getNodeType() == Node.ELEMENT_NODE) {
  7. return node.cast();
  8. }
  9. }
  10. return null;
  11. }

代码示例来源:origin: gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static Element getCellElement(CellFormatter cellFormatter, Element table, int row, int col) {
  3. TableRowElement rowElement = (TableRowElement) table.getChildNodes().getItem(row);
  4. return rowElement.getChildNodes().getItem(col).cast();
  5. }

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

  1. public Element getInfoTextContainer(NodeDescriptor node) {
  2. if (node.getPresentableTextContainer() == null) {
  3. Element element = getNodeContainer(node).getChildNodes().getItem(4).cast();
  4. node.setInfoTextContainer(element);
  5. }
  6. return node.getInfoTextContainer();
  7. }

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

  1. public Element getJointContainer(NodeDescriptor node) {
  2. if (node.getJointContainerElement() == null) {
  3. Element element = getNodeContainer(node).getChildNodes().getItem(0).cast();
  4. node.setJointContainerElement(element);
  5. }
  6. return node.getJointContainerElement();
  7. }

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

  1. public Element getUserElementContainer(NodeDescriptor node) {
  2. if (node.getUserElement() == null) {
  3. Element element = getNodeContainer(node).getChildNodes().getItem(2).cast();
  4. node.setUserElement(element);
  5. }
  6. return node.getUserElement();
  7. }

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

  1. public Element getDescendantsContainer(NodeDescriptor node) {
  2. if (node.getDescendantsContainerElement() == null) {
  3. Element element = getRootContainer(node).getChildNodes().getItem(1).cast();
  4. node.setDescendantsContainerElement(element);
  5. }
  6. return node.getDescendantsContainerElement();
  7. }

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

  1. public Element getIconContainer(NodeDescriptor node) {
  2. if (node.getIconContainerElement() == null) {
  3. Element element = getNodeContainer(node).getChildNodes().getItem(1).cast();
  4. node.setIconContainerElement(element);
  5. }
  6. return node.getIconContainerElement();
  7. }

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

  1. public Element getPresentableTextContainer(NodeDescriptor node) {
  2. if (node.getPresentableTextContainer() == null) {
  3. Element element = getNodeContainer(node).getChildNodes().getItem(3).cast();
  4. node.setPresentableTextContainer(element);
  5. }
  6. return node.getPresentableTextContainer();
  7. }

代码示例来源:origin: com.extjs/gxt

  1. protected void doWidth(int col, int w, int tw) {
  2. if (!enableGrouping) return;
  3. NodeList<Element> gs = getGroups();
  4. for (int i = 0, len = gs.getLength(); i < len; i++) {
  5. Element s = gs.getItem(i).getChildNodes().getItem(2).cast();
  6. El.fly(s).setWidth(tw);
  7. El.fly(s.getFirstChildElement()).setWidth(tw);
  8. TableSectionElement tse = s.getFirstChildElement().cast();
  9. Element e = tse.getRows().getItem(0).getChildNodes().getItem(col).cast();
  10. El.fly(e).setWidth(w);
  11. }
  12. }

相关文章

Element类方法