}
return null;
}
public void reload(TreeNode node) {
TreePath selection = PluginTree.getInstance() != null ? PluginTree.getInstance().getSelectionPath() : null;
TreePath treePath = new TreePath(getPathToRoot(node));
Enumeration<TreePath> e = null;
if (treePath != null) {
PluginTree t = PluginTree.getInstance();
if (t != null) {
e = PluginTree.getInstance().getExpandedDescendants(treePath);
}
}
super.reload(node);
if (e != null) {
while (e.hasMoreElements()) {
TreePath tree = e.nextElement();
Object[] o = tree.getPath();
for (int i = 1; i < o.length; i++) {
TreeNode[] pathNodes = getPathToRoot((TreeNode) o[i]);
if (node == null || pathNodes[0].toString().compareTo("Plugins") != 0) {
TreeNode n1 = (TreeNode) o[i - 1];
@SuppressWarnings("unchecked")
Enumeration<DefaultMutableTreeNode> e1 = n1.children();
while (e1.hasMoreElements()) {
TreeNode n2 = e1.nextElement();
if (n2.toString().compareTo(o[i].toString()) == 0) {
o[i] = n2;
break;
}
}
}
}
tree = new TreePath(o);
PluginTree.getInstance().expandPath(tree);
}
}
if(selection != null) {