1 package no.uio.ifi.refaktor.change.changers;
3 import no.uio.ifi.refaktor.analyze.ExtractAndMoveMethodCandidate;
4 import no.uio.ifi.refaktor.analyze.analyzers.ProjectWideExtractAndMoveMethodAnalyzer;
5 import no.uio.ifi.refaktor.analyze.exceptions.RefaktorAnalyzerException;
6 import no.uio.ifi.refaktor.change.executors.ExtractAndMoveMethodExecutor;
8 import org.eclipse.core.resources.IProject;
9 import org.eclipse.core.runtime.CoreException;
10 import org.eclipse.core.runtime.IProgressMonitor;
11 import org.eclipse.jdt.core.IJavaProject;
14 * A {@link RefaktorChanger} that is responsible for analyzing all of the methods
15 * in a project and execute the {@link ExtractAndMoveMethodExecutor} on all of the
16 * positive results from the analysis. See {@link ExtractAndMoveMethodCandidate}.
18 * This is done with the help of a {@link ProjectWideExtractAndMoveMethodAnalyzer}
19 * and an {@link AggregationAnalyzerChanger}.
21 public class ProjectWideExtractAndMoveMethodChanger implements RefaktorChanger {
23 private AggregationAnalyzerChanger changer;
25 public ProjectWideExtractAndMoveMethodChanger(IProject project) {
26 changer = new AggregationAnalyzerChanger(new ProjectWideExtractAndMoveMethodAnalyzer(project));
29 public ProjectWideExtractAndMoveMethodChanger(IJavaProject javaProject) {
30 changer = new AggregationAnalyzerChanger(new ProjectWideExtractAndMoveMethodAnalyzer(javaProject));
34 public void checkPreconditions() throws RefaktorAnalyzerException {
35 changer.checkPreconditions();
39 public void execute(IProgressMonitor monitor) throws CoreException {
40 changer.execute(monitor);