Object (@NotNull String dataId) { if (CommonDataKeys.NAVIGATABLE.is(dataId)) { TreePath selection = getSelectionPath(); Object o = selection == null ? null : selection.getLastPathComponent(); return o instanceof Navigatable ? o : null; } else if (CopyValueAction.SELECTED_NODE.is(dataId)) { TreePath selection = getSelectionPath(); return selection == null ? null : selection.getLastPathComponent(); } return null; }