@Override
	public synchronized void setCancelEnabled(boolean enable) {
		if (origCancelEnabled == null) {
			origCancelEnabled = isCancelEnabled();
		}
		super.setCancelEnabled(enable);
	}
A {@link TaskMonitor} wrapper that restores all changed values of the wrapped TaskMonitor when
the wrapper is {@link #close() closed}.
Ghidra/Framework/Generic/src/main/java/ghidra/util/task/PreserveStateWrappingTaskMonitor.java