@Override
public RefactoringStatus checkConditions(IProgressMonitor monitor, CheckConditionsContext context)
throws OperationCanceledException {
// REVIEWME: what to do w/ ResourceChangeChecker and/or ValidateEditChecker
CopyArguments arguments = getArguments();
Object destination = arguments.getDestination();
if (destination == null || destination instanceof IResource == false) {
return copyChange.getRefactorController().createRefactoringStatus(RefactoringStatus.FATAL,
"Destination is unknown or is not a resource");
}
IResource resource = (IResource) destination;
RefactoringStatus refactoringStatus = null;
try {
refactoringStatus = copyChange.checkConditions(resource, monitor);
ChangeRefactorModel refactorModel = copyChange.getRefactorController().getRefactorModel();
// the destination might have been change
if (refactorModel.isDestinationUpdated()) {
CopyArguments newCopyArguments = new CopyArguments(resource, arguments.getExecutionLog());
if (logger.isInfoEnabled()) {
logger.info("Destination changed from '" + resource.getProjectRelativePath().toPortableString()
+ "' to '" + refactorModel.getDestinationPath() + "'");
}
initialize(newCopyArguments);