use of org.eclipse.ltk.internal.core.refactoring.resource.DeleteResourcesProcessor in project che by eclipse.
the class DeleteResourcesDescriptor method createRefactoring.
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.RefactoringDescriptor#createRefactoring(org.eclipse.ltk.core.refactoring.RefactoringStatus)
*/
public Refactoring createRefactoring(RefactoringStatus status) throws CoreException {
IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
IResource[] resources = new IResource[fResourcePaths.length];
for (int i = 0; i < fResourcePaths.length; i++) {
IResource resource = wsRoot.findMember(fResourcePaths[i]);
if (resource == null || !resource.exists()) {
status.addFatalError(Messages.format(RefactoringCoreMessages.DeleteResourcesDescriptor_error_delete_not_exists, BasicElementLabels.getPathLabel(fResourcePaths[i], false)));
return null;
}
resources[i] = resource;
}
DeleteResourcesProcessor processor = new DeleteResourcesProcessor(resources, fDeleteContents);
return new DeleteRefactoring(processor);
}
Aggregations