@Override
	public boolean applyTo(T obj, TaskMonitor monitor) {
		// Run commands in the order they were added
		for (Command<T> cmd : cmdList) {
			if (monitor.isCancelled()) {
				setStatusMsg("Cancelled");
				return false;
			}
			boolean success;
			if (cmd instanceof BackgroundCommand<T> bcmd) {
				success = bcmd.applyTo(obj, monitor);
			}
			else {
				success = cmd.applyTo(obj);
			}
			if (!success) {
				setStatusMsg(cmd.getStatusMsg());
				return false;
			}
		}
		return true;
	}
Constructor
@param name name of the command
@param modal true means the monitor dialog is modal and the command has to
       complete or be canceled before any other action can occur
@param canCancel true means the command can be canceled
Ghidra/Framework/Project/src/main/java/ghidra/framework/cmd/CompoundBackgroundCommand.java