Bug 29163 SafeRunnable needs to be accessible in JFace
We need to be able to access the SafeRunnable in JFace in order that some error protection can be added to preferences and properties dialogs.
bundles/org.eclipse.ui.workbench/extensions/org/eclipse/jface/operation/ModalContext.java
* a wrapper around, the second progress monitor.
 *
 * @param monitor1 the first progress monitor
 * @param monitor2 the second progress monitor
 * @return <code>true</code> if the first is the same as, or
 *   a wrapper around, the second
 * @see ProgressMonitorWrapper
 */
public static boolean canProgressMonitorBeUsed(IProgressMonitor monitor1, IProgressMonitor monitor2) {
	if (monitor1 == monitor2)
		return true;
		
	while (monitor1 instanceof ProgressMonitorWrapper) {
		monitor1= ((ProgressMonitorWrapper)monitor1).getWrappedProgressMonitor();
		if (monitor1 == monitor2)
			return true;
	}
	return false;
}
/**
 * Checks with the given progress monitor and throws 
 * <code>InterruptedException</code> if it has been canceled.
 * <p>
 * Code in a long-running operation should call this method
 * regularly so that a request to cancel will be honored.
 * </p>
 * <p>
 * Convenience for:
 * <pre>
 * if (monitor.isCanceled())