tree.setSelectionPath(path);
tree.scrollPathToVisible(path);
}
private TreePath findAttributeChildNode(TreePath path, Class<? extends AttributeInfo> attributeClass) {
BrowserTreeNode methodNode = (BrowserTreeNode)path.getLastPathComponent();
for (int i = 0; i < methodNode.getChildCount(); i++) {
BrowserTreeNode attributeNode = (BrowserTreeNode)methodNode.getChildAt(i);
if (attributeNode.getElement().getClass() == attributeClass) {
return path.pathByAddingChild(attributeNode);
}
}
throw new RuntimeException("No attribute node for class " + attributeClass + " found");
}