@Nullable StubElement<?> getSelectedStub() {
    TreePath selectionPath = myStubTree.getSelectionPath();
    return selectionPath != null
           ? ((StubTreeNode)((DefaultMutableTreeNode)selectionPath.getLastPathComponent()).getUserObject()).getStub()
           : null;
  }
@Nullable StubElement<?> getSelectedStub()