RepositoryTreeNode () { TreePath selection = myRepositoryTree.getSelectionPath(); if (selection != null && selection.getLastPathComponent() instanceof RepositoryTreeNode) { return (RepositoryTreeNode)selection.getLastPathComponent(); } return null; }