DebuggerTreeNodeImpl (DataContext dataContext) { DebuggerTree tree = getTree(dataContext); if (tree == null) return null; if (tree.getSelectionCount() != 1) { return null; } TreePath path = tree.getSelectionPath(); if (path == null) { return null; } Object component = path.getLastPathComponent(); if (!(component instanceof DebuggerTreeNodeImpl)) { return null; } return (DebuggerTreeNodeImpl)component; }