private StandAloneDataTypeManager getModifiableProjectOrFileDTM(TreePath[] selectionPaths) {
		// only valid if single file or project archive node is selected
		if (selectionPaths.length != 1) {
			return null;
		}

		TreePath path = selectionPaths[0];
		if (path.getPathCount() < 2) {
			return null;
		}

		GTreeNode node = (GTreeNode) path.getPathComponent(1);
		if (!(node instanceof FileArchiveNode) && !(node instanceof ProjectArchiveNode)) {
			return null;
		}

		ArchiveNode archiveNode = (ArchiveNode) node;
		if (archiveNode.isModifiable()) {
			DataTypeManager dtm = archiveNode.getArchive().getDataTypeManager();
			if (dtm instanceof StandAloneDataTypeManager archiveDtm) {
				return archiveDtm;
			}
		}
		return null;
	}
Execute the undo/redo operation on the specified archive datatype manager.
@param dtm archive datatype manager
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/actions/AbstractUndoRedoArchiveTransactionAction.java