private RefactoringStatus checkSelection() throws JavaModelException { if (fAST.hasProblems()){ RefactoringStatus compileErrors= Checks.checkCompileErrors(fAST, fCu); if (compileErrors.hasFatalError()) return compileErrors; }
private RefactoringStatus checkSelection(IProgressMonitor pm) throws JavaModelException { try{ pm.beginTask("", 9);  if (fAST.hasProblems()){ RefactoringStatus compileErrors= Checks.checkCompileErrors(fAST, fCu); if (compileErrors.hasFatalError()) return compileErrors; } pm.worked(1);  if (analyzeSelection().getSelectedNodes() == null || analyzeSelection().getSelectedNodes().length != 1) return RefactoringStatus.createFatalErrorStatus("An expression must be selected to activate this refactoring."); pm.worked(1);  if (isUsedInExplicitConstructorCall()) return RefactoringStatus.createFatalErrorStatus("Code from explicit constructor calls cannot be extracted to a variable."); pm.worked(1);  if (getSelectedMethodNode() == null) return RefactoringStatus.createFatalErrorStatus("An expression used in a method must be selected to activate this refactoring."); pm.worked(1);  if (getSelectedExpression() == null) return RefactoringStatus.createFatalErrorStatus("An expression must be selected to activate this refactoring."); pm.worked(1);  if (! isSelectionUsedAsExpression()) return RefactoringStatus.createFatalErrorStatus("An expression must be selected to activate this refactoring."); pm.worked(1);
	private RefactoringStatus checkSelection() throws JavaModelException {		if (fAST.hasProblems()){			RefactoringStatus compileErrors= Checks.checkCompileErrors(fAST, fCu);			if (compileErrors.hasFatalError())				return compileErrors;		}		if (analyzeSelection().getSelectedNodes() == null || analyzeSelection().getSelectedNodes().length != 1)			return RefactoringStatus.createFatalErrorStatus("An expression must be selected to activate this refactoring.");				if (isUsedInExplicitConstructorCall())			return RefactoringStatus.createFatalErrorStatus("Code from explicit constructor calls cannot be extracted to a variable.");					if (getSelectedMethodNode() == null)			return RefactoringStatus.createFatalErrorStatus("An expression used in a method must be selected to activate this refactoring.");								if (getSelectedExpression() == null)			return RefactoringStatus.createFatalErrorStatus("An expression must be selected to activate this refactoring.");				if (! isSelectionUsedAsExpression()) //XXX should enable at some point			return RefactoringStatus.createFatalErrorStatus("An expression must be selected to activate this refactoring.");					if (analyzeSelection().getExpressionTypeBinding() == null)			return RefactoringStatus.createFatalErrorStatus("An expression must be selected to activate this refactoring.");				initializeTempNames(); 		return new RefactoringStatus();	}