1 package no.uio.ifi.refaktor.change;
3 import no.uio.ifi.refaktor.change.exceptions.ExecutorManagerInitializationException;
4 import no.uio.ifi.refaktor.change.exceptions.SingleExecutionViolationException;
5 import no.uio.ifi.refaktor.change.executors.Executor;
7 import org.eclipse.core.runtime.CoreException;
8 import org.eclipse.core.runtime.IProgressMonitor;
10 public class SingleExecutionExecutorManager implements ExecutorManager {
11 private Executor executor;
12 private boolean isExecuted;
14 public SingleExecutionExecutorManager() {
18 public SingleExecutionExecutorManager(Executor executor) {
19 setExecutor(executor);
23 public void setExecutor(Executor executor) {
24 this.executor = executor;
29 public void executeChange(IProgressMonitor monitor) throws CoreException {
31 throw new ExecutorManagerInitializationException(this.getClass().getSimpleName() + ": No executor set!");
34 throw new SingleExecutionViolationException("The change can only be executed once!");
36 executor.execute(monitor);
40 private void markAsExecuted() {