public ActionContext getActionContext(ComponentProvider provider, MouseEvent e) {
		if (root instanceof NoProjectNode) {
			return null;
		}

		if (e != null) {
			Component component = e.getComponent();
			if (!(component instanceof JTree)) {
				return null;
			}
		}

		TreePath[] selectionPaths = tree.getSelectionPaths();

		List<DomainFile> domainFileList = new ArrayList<>();
		List<DomainFolder> domainFolderList = new ArrayList<>();

		for (TreePath treePath : selectionPaths) {
			GTreeNode node = (GTreeNode) treePath.getLastPathComponent();
			if (node instanceof DomainFolderNode) {
				domainFolderList.add(((DomainFolderNode) node).getDomainFolder());
			}
			else if (node instanceof DomainFileNode) {
				domainFileList.add(((DomainFileNode) node).getDomainFile());
			}
		}

		// provider is null when called from the DataTreeDialog, use different context
		if (provider == null) {
			return new DialogProjectTreeContext(projectData, selectionPaths, domainFolderList,
				domainFileList, tree);
		}

		return new FrontEndProjectTreeContext(provider, projectData, selectionPaths,
			domainFolderList, domainFileList, tree, isActiveProject);
	}
Get the data tree node that is selected

@param provider the provider with which to construct the new context 
@param e mouse event for the popup; may be null if this is being called as a result of 
       the key binding pressed
@return the new context; null if there is no selection
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/ProjectDataTreePanel.java