public ActionContext getDomainFileActionContext(GTreeNode... nodes) {

		List<DomainFile> fileList = new ArrayList<>();
		List<DomainFolder> folderList = new ArrayList<>();
		TreePath[] treePaths = new TreePath[nodes.length];
		for (int i = 0; i < nodes.length; i++) {
			GTreeNode node = nodes[i];
			treePaths[i] = node.getTreePath();
			if (node instanceof DomainFileNode) {
				fileList.add(((DomainFileNode) node).getDomainFile());
			}
			else if (node instanceof DomainFolderNode) {
				folderList.add(((DomainFolderNode) node).getDomainFolder());
			}
		}

		if (isFrontEndTree) {
			boolean isActiveProject = tree.getName().equals("Data Tree");
			return new FrontEndProjectTreeContext(null, rootNode.getDomainFolder().getProjectData(),
				treePaths, folderList, fileList, tree, isActiveProject);
		}

		return new ProjectDataContext(null, rootNode.getDomainFolder().getProjectData(), nodes[0],
			folderList, fileList, tree, true);

	}
This class provides some convenience methods for interacting with a {@link DataTree}.
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/test/DataTreeHelper.java