/** * Overrides the super to prevent selection of place holder accounts * * @param path new path to select */ @Override public void setSelectionPath(final TreePath path) { if (path != null) { Object o = path.getLastPathComponent(); if (o != null) { Account a = (Account) ((DefaultMutableTreeNode) o).getUserObject(); if (a != null && isAccountEnabled(a)) { super.setSelectionPath(path); } } } else { super.setSelectionPath(null); } }
@Override public void setSelectionPath(TreePath path) { if (path.getLastPathComponent() instanceof HierarchicalData) super.setSelectionPath(path); }