use of org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange in project che by eclipse.
the class UndoDeleteResourceChange method perform.
public Change perform(IProgressMonitor pm) throws CoreException {
if (fResourceState.verifyExistence(true)) {
String message = Messages.format(RefactoringCoreMessages.UndoDeleteResourceChange_already_exists, BasicElementLabels.getResourceName(fResourceState.getName()));
throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), message));
}
IResource created = fResourceState.createResource(pm);
created.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(pm, 1));
DeleteResourceChange change = new DeleteResourceChange(created.getFullPath(), true, false);
change.setValidationMethod(ResourceChange.VALIDATE_NOT_READ_ONLY | ResourceChange.VALIDATE_NOT_DIRTY);
return change;
}
Aggregations