Url () { TreePath selection = myRepositoryTree.getSelectionPath(); if (selection == null) { return null; } Object element = selection.getLastPathComponent(); if (element instanceof RepositoryTreeNode node) { return node.getURL(); } return null; }