public boolean isOnlyRootNodeSelected() {
		ProgramDnDTree tree = getTree();
		if (tree == null) {
			return false;
		}
		TreePath[] paths = tree.getSelectionPaths();
		if (paths == null || paths.length != 1) {
			return false;
		}

		ProgramNode node = (ProgramNode) paths[0].getLastPathComponent();
		DefaultTreeModel treeModel = (DefaultTreeModel) tree.getModel();
		ProgramNode root = (ProgramNode) treeModel.getRoot();
		return node == root;
	}
A context object for the {@link ProgramTreePlugin}.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreeActionContext.java