本文整理了Java中com.google.gwt.dom.client.Element.getChildNodes()
方法的一些代码示例,展示了Element.getChildNodes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getChildNodes()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getChildNodes
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
private void updateVisibility(Element container) {
// If this element has an associated layer, re-run layout for it.
Layer layer = getLayer(container);
if (layer != null) {
layout(layer);
}
// Walk all children, looking for elements with a '__layer' property. If one
// exists, call layout() for that element. This is not cheap, but it's the
// only way to correctly ensure that layout units get translated correctly.
NodeList<Node> nodes = container.getChildNodes();
for (int i = 0; i < nodes.getLength(); ++i) {
Node node = nodes.getItem(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
updateVisibility(node.<Element>cast());
}
}
}
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static Element getChild(DOMImpl domImpl, Element userElem, int index) {
if (index >= userElem.getChildNodes().getLength()) {
return null;
}
return userElem.getChildNodes().getItem(index).cast();
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static int getChildIndex(DOMImpl domImpl, Element parent, Element child) {
if (parent == null || child == null) {
return -1;
}
for (int i = 0; i < parent.getChildNodes().getLength(); i++) {
if (child.equals(parent.getChildNodes().getItem(i))) {
return i;
}
}
return -1;
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static Element getChild(DOMImpl domImpl, Element userElem, int index) {
if (index >= userElem.getChildNodes().getLength()) {
return null;
}
return userElem.getChildNodes().getItem(index).cast();
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static int getDOMRowCount(HTMLTable table, Element element) {
return element.getChildNodes().getLength();
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static int getChildIndex(DOMImpl domImpl, Element parent, Element child) {
if (parent == null || child == null) {
return -1;
}
for (int i = 0; i < parent.getChildNodes().getLength(); i++) {
if (child.equals(parent.getChildNodes().getItem(i))) {
return i;
}
}
return -1;
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static int getDOMCellCount(HTMLTable table, Element element, int row) {
return element.getChildNodes().getItem(row).getChildNodes().getLength();
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
private void handleRowCells(Grid wrapped, Element element) {
int columnIndex = 0;
NodeList<Node> childs = element.getChildNodes();
for (int i = 0; i < childs.getLength(); i++) {
Element e = childs.getItem(i).cast();
if (CELL_TAG.equals(e.getTagName())) {
handleCell(wrapped, e, columnIndex++);
} else if (CUSTOMCELL_TAG.equals(e.getTagName())) {
handleCustomCell(wrapped, e, UiBinderXmlUtils.getChildWidgets(e), columnIndex++);
}
}
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
private void handleRowCells(Grid wrapped, Element element) {
int columnIndex = 0;
NodeList<Node> childs = element.getChildNodes();
for (int i = 0; i < childs.getLength(); i++) {
Element e = childs.getItem(i).cast();
if (CELL_TAG.equals(e.getTagName())) {
handleCell(wrapped, e, columnIndex++);
} else if (CUSTOMCELL_TAG.equals(e.getTagName())) {
handleCustomCell(wrapped, e, UiBinderXmlUtils.getChildWidgets(e), columnIndex++);
}
}
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static Element getCellElement(CellFormatter cellFormatter, Element table, int row, int col) {
TableRowElement rowElement = (TableRowElement) table.getChildNodes().getItem(row);
return rowElement.getChildNodes().getItem(col).cast();
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static Element getFirstChildElement(Object domImpl, Element elem) {
NodeList<Node> nodeList = elem.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.getItem(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
return node.cast();
}
}
return null;
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static Element getFirstChildElement(Object domImpl, Element elem) {
NodeList<Node> nodeList = elem.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.getItem(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
return node.cast();
}
}
return null;
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static Element getCellElement(CellFormatter cellFormatter, Element table, int row, int col) {
TableRowElement rowElement = (TableRowElement) table.getChildNodes().getItem(row);
return rowElement.getChildNodes().getItem(col).cast();
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
public Element getInfoTextContainer(NodeDescriptor node) {
if (node.getPresentableTextContainer() == null) {
Element element = getNodeContainer(node).getChildNodes().getItem(4).cast();
node.setInfoTextContainer(element);
}
return node.getInfoTextContainer();
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
public Element getJointContainer(NodeDescriptor node) {
if (node.getJointContainerElement() == null) {
Element element = getNodeContainer(node).getChildNodes().getItem(0).cast();
node.setJointContainerElement(element);
}
return node.getJointContainerElement();
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
public Element getUserElementContainer(NodeDescriptor node) {
if (node.getUserElement() == null) {
Element element = getNodeContainer(node).getChildNodes().getItem(2).cast();
node.setUserElement(element);
}
return node.getUserElement();
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
public Element getDescendantsContainer(NodeDescriptor node) {
if (node.getDescendantsContainerElement() == null) {
Element element = getRootContainer(node).getChildNodes().getItem(1).cast();
node.setDescendantsContainerElement(element);
}
return node.getDescendantsContainerElement();
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
public Element getIconContainer(NodeDescriptor node) {
if (node.getIconContainerElement() == null) {
Element element = getNodeContainer(node).getChildNodes().getItem(1).cast();
node.setIconContainerElement(element);
}
return node.getIconContainerElement();
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
public Element getPresentableTextContainer(NodeDescriptor node) {
if (node.getPresentableTextContainer() == null) {
Element element = getNodeContainer(node).getChildNodes().getItem(3).cast();
node.setPresentableTextContainer(element);
}
return node.getPresentableTextContainer();
}
代码示例来源:origin: com.extjs/gxt
protected void doWidth(int col, int w, int tw) {
if (!enableGrouping) return;
NodeList<Element> gs = getGroups();
for (int i = 0, len = gs.getLength(); i < len; i++) {
Element s = gs.getItem(i).getChildNodes().getItem(2).cast();
El.fly(s).setWidth(tw);
El.fly(s.getFirstChildElement()).setWidth(tw);
TableSectionElement tse = s.getFirstChildElement().cast();
Element e = tse.getRows().getItem(0).getChildNodes().getItem(col).cast();
El.fly(e).setWidth(w);
}
}
内容来源于网络,如有侵权,请联系作者删除!