Bug 19857 Refactor - need two undos to completely undo method extraction [refactoring]
Build F2 If you use Refactor to extract a method, it requires two 'Undo' operations to undo the refactoring. The first Undo removes the call to the new method, and the second Undo removes the new method. Refactor->Extract Method is a single operation, so it should only require a single Undo.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/SurroundWithTryCatchAction.java
new BusyIndicatorRunnableContext().run(false, false, op);
		} catch (CoreException e) {
			ExceptionHandler.handle(e, getDialogTitle(), RefactoringMessages.getString("SurroundWithTryCatchAction.exception")); 
		} catch (InvocationTargetException e) {
			ExceptionHandler.handle(e, getDialogTitle(), RefactoringMessages.getString("SurroundWithTryCatchAction.exception")); 
		} catch (InterruptedException e) {
			
		}
	}
	 void editorStateChanged() {
		setEnabled(fEditor != null && !fEditor.isEditorInputReadOnly() && getCompilationUnit() != null);
	}
	
	protected void selectionChanged(ITextSelection selection) {
		setEnabled(selection.getLength() > 0 && checkEditor());
	}
	
	private final ICompilationUnit getCompilationUnit() {
		return SelectionConverter.getInputAsCompilationUnit(fEditor);
	}
	
	private boolean checkEditor() {
		return fEditor != null && !fEditor.isEditorInputReadOnly() && getCompilationUnit() != null;
	}
	
	private static String getDialogTitle() {
		return RefactoringMessages.getString("SurroundWithTryCatchAction.dialog.title"); 
	}
}