List of usage examples for org.eclipse.jface.viewers TreeNode equals
@Override
public boolean equals(final Object object)
From source file:com.salesforce.ide.ui.packagemanifest.PackageTreeNode.java
License:Open Source License
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PackageTreeNode other = (PackageTreeNode) obj; if (value == null) { if (other.value != null) return false; } else if (!value.equals(other.getValue())) { return false; } else {/*from w ww .j a va2 s . c o m*/ final TreeNode parent = getParent(); while (parent != null) { if (!parent.equals(other.getParent())) { return false; } break; } } return true; }
From source file:org.kalypso.ui.rrm.internal.utils.featureTree.TreeNodeModel.java
License:Open Source License
private TreeNode findNode(final TreeNode node, final TreeNode nodeToSelect) { if (node.equals(nodeToSelect)) return node; final TreeNode[] children = node.getChildren(); for (final TreeNode child : children) { final TreeNode found = findNode(child, nodeToSelect); if (Objects.isNotNull(found)) return found; }//from ww w.j a v a2 s. c o m return null; }