1 11 package org.eclipse.ltk.core.refactoring.participants; 12 13 import org.eclipse.core.runtime.Assert; 14 import org.eclipse.core.runtime.CoreException; 15 import org.eclipse.core.runtime.IProgressMonitor; 16 import org.eclipse.core.runtime.OperationCanceledException; 17 import org.eclipse.core.runtime.PlatformObject; 18 19 import org.eclipse.ltk.core.refactoring.Change; 20 import org.eclipse.ltk.core.refactoring.RefactoringStatus; 21 22 54 public abstract class RefactoringProcessor extends PlatformObject { 55 56 private ProcessorBasedRefactoring fRefactoring; 57 58 65 void setRefactoring(ProcessorBasedRefactoring refactoring) { 66 Assert.isTrue(fRefactoring == null, "The refactoring can only be set once"); Assert.isNotNull(refactoring); 68 fRefactoring= refactoring; 69 } 70 71 79 public ProcessorBasedRefactoring getRefactoring() { 80 return fRefactoring; 81 } 82 83 91 public abstract Object [] getElements(); 92 93 99 public abstract String getIdentifier(); 100 101 107 public abstract String getProcessorName(); 108 109 119 public abstract boolean isApplicable() throws CoreException; 120 121 149 public abstract RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException; 150 151 176 public abstract RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) 177 throws CoreException, OperationCanceledException; 178 179 194 public abstract Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException; 195 196 212 public Change postCreateChange(Change[] participantChanges, IProgressMonitor pm) throws CoreException, OperationCanceledException { 213 return null; 214 } 215 216 255 public abstract RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException; 256 } 257 | Popular Tags |