final MessageDialogWithToggle dialog= MessageDialogWithToggle.openOkCancelConfirm(getShell(), getShell().getText(), format.format(new Object[] { Integer.valueOf(fExecutedRefactorings)}), RefactoringUIMessages.RefactoringHistoryWizard_do_not_show_message, false, null, null);
final MessageDialogWithToggle dialog= MessageDialogWithToggle.openOkCancelConfirm(getShell(), getShell().getText(), format.format(new Object[] { new Integer(fExecutedRefactorings)}), RefactoringUIMessages.RefactoringHistoryWizard_do_not_show_message, false, null, null);
	public boolean performCancel() {		if (fExecutedRefactorings > 0 && !fCancelException) {			final IPreferenceStore store= RefactoringUIPlugin.getDefault().getPreferenceStore();			if (!store.getBoolean(PREFERENCE_DO_NOT_WARN_UNDO_ON_CANCEL)) {				final MessageFormat format= new MessageFormat(RefactoringUIMessages.RefactoringHistoryWizard_undo_message_pattern);				final String message= RefactoringUIMessages.RefactoringHistoryWizard_undo_message_explanation;				final String[] messages= { RefactoringUIMessages.RefactoringHistoryWizard_one_refactoring_undone + message, RefactoringUIMessages.RefactoringHistoryWizard_several_refactorings_undone + message};				final ChoiceFormat choice= new ChoiceFormat(new double[] { 1, Double.MAX_VALUE}, messages);				format.setFormatByArgumentIndex(0, choice);				final MessageDialogWithToggle dialog= MessageDialogWithToggle.openOkCancelConfirm(getShell(), getShell().getText(), format.format(new Object[] { Integer.valueOf(fExecutedRefactorings)}), RefactoringUIMessages.RefactoringHistoryWizard_do_not_show_message, false, null, null);				store.setValue(PREFERENCE_DO_NOT_WARN_UNDO_ON_CANCEL, dialog.getToggleState());				if (dialog.getReturnCode() == 1)					return false;			}			final IRunnableWithProgress runnable= new IRunnableWithProgress() {				public final void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {					for (int index= 0; index < fExecutedRefactorings; index++) {						try {							RefactoringCore.getUndoManager().performUndo(null, new SubProgressMonitor(monitor, 100));							if (fExecutedRefactorings > 0)								fExecutedRefactorings--;						} catch (CoreException exception) {							throw new InvocationTargetException(exception);						}					}				}			};			try {				getContainer().run(false, false, runnable);			} catch (InvocationTargetException exception) {				RefactoringUIPlugin.log(exception);				fCancelException= true;				fErrorPage.setStatus(RefactoringStatus.createFatalErrorStatus(RefactoringUIMessages.RefactoringHistoryWizard_internal_error));				fErrorPage.setNextPageDisabled(true);				fErrorPage.setTitle(RefactoringUIMessages.RefactoringHistoryWizard_internal_error_title);				fErrorPage.setDescription(RefactoringUIMessages.RefactoringHistoryWizard_internal_error_description);				getContainer().showPage(fErrorPage);				return false;			} catch (InterruptedException exception) {				// Does not happen			}		}		return super.performCancel();	}