本文整理了Java中com.google.gwt.user.client.ui.Tree.findItemByChain()
方法的一些代码示例,展示了Tree.findItemByChain()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.findItemByChain()
方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Tree
类名称:Tree
方法名:findItemByChain
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
private TreeItem findItemByChain(ArrayList<Element> chain, int idx,
TreeItem root) {
if (idx == chain.size()) {
return root;
}
Element hCurElem = chain.get(idx);
for (int i = 0, n = root.getChildCount(); i < n; ++i) {
TreeItem child = root.getChild(i);
if (child.getElement() == hCurElem) {
TreeItem retItem = findItemByChain(chain, idx + 1, root.getChild(i));
if (retItem == null) {
return child;
}
return retItem;
}
}
return findItemByChain(chain, idx + 1, root);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private boolean elementClicked(Element hElem) {
ArrayList<Element> chain = new ArrayList<Element>();
collectElementChain(chain, getElement(), hElem);
TreeItem item = findItemByChain(chain, 0, root);
if (item != null && item != root) {
if (item.getChildCount() > 0
&& item.getImageElement().isOrHasChild(hElem)) {
item.setState(!item.getState(), true);
return true;
} else if (item.getElement().isOrHasChild(hElem)) {
onSelection(item, true, !shouldTreeDelegateFocusToElement(hElem));
return true;
}
}
return false;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private TreeItem findItemByChain(ArrayList<Element> chain, int idx,
TreeItem root) {
if (idx == chain.size()) {
return root;
}
Element hCurElem = chain.get(idx);
for (int i = 0, n = root.getChildCount(); i < n; ++i) {
TreeItem child = root.getChild(i);
if (child.getElement() == hCurElem) {
TreeItem retItem = findItemByChain(chain, idx + 1, root.getChild(i));
if (retItem == null) {
return child;
}
return retItem;
}
}
return findItemByChain(chain, idx + 1, root);
}
代码示例来源:origin: net.wetheinter/gwt-user
private TreeItem findItemByChain(ArrayList<Element> chain, int idx,
TreeItem root) {
if (idx == chain.size()) {
return root;
}
Element hCurElem = chain.get(idx);
for (int i = 0, n = root.getChildCount(); i < n; ++i) {
TreeItem child = root.getChild(i);
if (child.getElement() == hCurElem) {
TreeItem retItem = findItemByChain(chain, idx + 1, root.getChild(i));
if (retItem == null) {
return child;
}
return retItem;
}
}
return findItemByChain(chain, idx + 1, root);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
ArrayList<Element> chain = new ArrayList<Element>();
collectElementChain(chain, getElement(), DOM.eventGetTarget(event));
TreeItem item = findItemByChain(chain, 0, root);
if (item != getSelectedItem()) {
setSelectedItem(item, true);
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private boolean elementClicked(Element hElem) {
ArrayList<Element> chain = new ArrayList<Element>();
collectElementChain(chain, getElement(), hElem);
TreeItem item = findItemByChain(chain, 0, root);
if (item != null && item != root) {
if (item.getChildCount() > 0
&& item.getImageElement().isOrHasChild(hElem)) {
item.setState(!item.getState(), true);
return true;
} else if (item.getElement().isOrHasChild(hElem)) {
onSelection(item, true, !shouldTreeDelegateFocusToElement(hElem));
return true;
}
}
return false;
}
代码示例来源:origin: net.wetheinter/gwt-user
private boolean elementClicked(Element hElem) {
ArrayList<Element> chain = new ArrayList<Element>();
collectElementChain(chain, getElement(), hElem);
TreeItem item = findItemByChain(chain, 0, root);
if (item != null && item != root) {
if (item.getChildCount() > 0
&& item.getImageElement().isOrHasChild(hElem)) {
item.setState(!item.getState(), true);
return true;
} else if (item.getElement().isOrHasChild(hElem)) {
onSelection(item, true, !shouldTreeDelegateFocusToElement(hElem));
return true;
}
}
return false;
}
代码示例来源:origin: net.wetheinter/gwt-user
ArrayList<Element> chain = new ArrayList<Element>();
collectElementChain(chain, getElement(), DOM.eventGetTarget(event));
TreeItem item = findItemByChain(chain, 0, root);
if (item != getSelectedItem()) {
setSelectedItem(item, true);
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
ArrayList<Element> chain = new ArrayList<Element>();
collectElementChain(chain, getElement(), DOM.eventGetTarget(event));
TreeItem item = findItemByChain(chain, 0, root);
if (item != getSelectedItem()) {
setSelectedItem(item, true);
内容来源于网络,如有侵权,请联系作者删除!