import no.uio.ifi.refaktor.prefix.PrefixSet;
import no.uio.ifi.refaktor.textselection.CompilationUnitTextSelection;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.Modifier;
-
//TODO: rewrite docs
/**
* A property extractor that collects all the expression prefixes within a selection
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import no.uio.ifi.refaktor.analyze.candidates.ExtractLocalVariableCandidate;
import no.uio.ifi.refaktor.analyze.candidates.RefactorCandidate;
-import no.uio.ifi.refaktor.change.changers.ExtractLocalVariableWithAssertsChanger;
import no.uio.ifi.refaktor.change.changers.RefaktorChanger;
import no.uio.ifi.refaktor.factories.RefactoringFactory;
import no.uio.ifi.refaktor.textselection.CompilationUnitTextSelection;
/**
* Text selection containing the expression we want to refactor, and only that
*/
- private CompilationUnitTextSelection textSelection;
- private String newName;
- private RefactoringFactory<Candidate> factory;
+ final private CompilationUnitTextSelection textSelection;
+ final private String newName;
+ final private RefactoringFactory<Candidate> factory;
public RefactoringExecutor(Candidate analysisResult, RefactoringFactory<Candidate> factory) {
this.factory = factory;
//TODO should be generic
RefaktorChanger changer = factory.getChanger(textSelection, newName);
changer.checkPreconditions();
- try {
- changer.execute(new NullProgressMonitor());
- } catch (CoreException e) {
- e.printStackTrace();
- }
+ changer.execute(monitor);
}
}
import no.uio.ifi.refaktor.analyze.candidates.ExtractLocalVariableCandidate;
import no.uio.ifi.refaktor.change.SearchBasedRefactorChanger;
import no.uio.ifi.refaktor.change.changers.ProjectWideRefactorChanger;
-import no.uio.ifi.refaktor.change.changers.RefaktorChanger;
-import no.uio.ifi.refaktor.change.changers.SearchBasedExtractAndMoveMethodChanger;
-import no.uio.ifi.refaktor.change.exceptions.RefaktorChangerException;
-import no.uio.ifi.refaktor.debugging.RefaktorDebug;
import no.uio.ifi.refaktor.factories.ExtractLocalVariableFactory;
import no.uio.ifi.refaktor.forTests.Refactorer;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.internal.core.JavaProject;
-import org.eclipse.jdt.internal.core.PackageFragment;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.core.resources.IProject;