public class DeleteResourceChange extends ResourceChange
Change
that deletes a resource.SAVE_IF_DIRTY, VALIDATE_DEFAULT, VALIDATE_NOT_DIRTY, VALIDATE_NOT_READ_ONLY
Constructor and Description |
---|
DeleteResourceChange(IPath resourcePath,
boolean forceOutOfSync)
Delete a resource.
|
DeleteResourceChange(IPath resourcePath,
boolean forceOutOfSync,
boolean deleteContent)
Delete a resource.
|
Modifier and Type | Method and Description |
---|---|
ChangeDescriptor |
getDescriptor()
Returns a descriptor of this change.
|
protected IResource |
getModifiedResource()
Returns the resource of this change.
|
String |
getName()
Returns the human readable name of this change.
|
Change |
perform(IProgressMonitor pm)
Performs this change.
|
void |
setDescriptor(ChangeDescriptor descriptor)
Sets the change descriptor to be returned by
Change.getDescriptor() . |
checkIfModifiable, getModifiedElement, initializeValidationData, isValid, setValidationMethod, toString
dispose, getAdapter, getAffectedObjects, getParent, isEnabled, setEnabled, setEnabledShallow
public DeleteResourceChange(IPath resourcePath, boolean forceOutOfSync)
resourcePath
- the resource pathforceOutOfSync
- if true
, deletes the resource with IResource.FORCE
public DeleteResourceChange(IPath resourcePath, boolean forceOutOfSync, boolean deleteContent)
resourcePath
- the project pathforceOutOfSync
- if true
, deletes the resource with IResource.FORCE
deleteContent
- if true
delete the project contents.
The content delete is not undoable. This setting only applies to projects and is not used when deleting files or folders.protected IResource getModifiedResource()
ResourceChange
getModifiedResource
in class ResourceChange
public String getName()
Change
null
.public Change perform(IProgressMonitor pm) throws CoreException
Change
IProgressMonitor.isCanceled()
since canceling a change tree in the
middle of its execution leaves the workspace in a half changed state.perform
in class Change
pm
- a progress monitornull
if no
undo is providedCoreException
- if an error occurred during change executionpublic ChangeDescriptor getDescriptor()
Change
Subclasses of changes created by
Refactoring.createChange(IProgressMonitor)
should override this
method to return a RefactoringChangeDescriptor
. A change tree
created by a particular refactoring is supposed to contain at most one
change which returns a refactoring descriptor. Refactorings usually
return an instance of CompositeChange
in their
Refactoring.createChange(IProgressMonitor)
method which
implements this method. The refactoring framework searches the change
tree top-down until a refactoring descriptor is found.
getDescriptor
in class Change
null
if this
change does not provide a change descriptor.public void setDescriptor(ChangeDescriptor descriptor)
Change.getDescriptor()
.descriptor
- the change descriptor
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.