Class DeleteResourceChange
java.lang.Object
org.eclipse.ltk.core.refactoring.Change
org.eclipse.ltk.core.refactoring.resource.ResourceChange
org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange
- All Implemented Interfaces:
IAdaptable
Change
that deletes a resource.- Since:
- 3.4
-
Field Summary
Fields inherited from class org.eclipse.ltk.core.refactoring.resource.ResourceChange
SAVE_IF_DIRTY, VALIDATE_DEFAULT, VALIDATE_NOT_DIRTY, VALIDATE_NOT_READ_ONLY
-
Constructor Summary
ConstructorDescriptionDeleteResourceChange
(IPath resourcePath, boolean forceOutOfSync) Delete a resource.DeleteResourceChange
(IPath resourcePath, boolean forceOutOfSync, boolean deleteContent) Delete a resource. -
Method Summary
Modifier and TypeMethodDescriptionReturns a descriptor of this change.protected IResource
Returns the resource of this change.getName()
Returns the human readable name of this change.Performs this change.void
setDescriptor
(ChangeDescriptor descriptor) Sets the change descriptor to be returned byChange.getDescriptor()
.Methods inherited from class org.eclipse.ltk.core.refactoring.resource.ResourceChange
checkIfModifiable, getModifiedElement, initializeValidationData, isValid, setValidationMethod, toString
Methods inherited from class org.eclipse.ltk.core.refactoring.Change
dispose, getAdapter, getAffectedObjects, getParent, isEnabled, setEnabled, setEnabledShallow
-
Constructor Details
-
DeleteResourceChange
Delete a resource.- Parameters:
resourcePath
- the resource pathforceOutOfSync
- iftrue
, deletes the resource withIResource.FORCE
-
DeleteResourceChange
Delete a resource.- Parameters:
resourcePath
- the project pathforceOutOfSync
- iftrue
, deletes the resource withIResource.FORCE
deleteContent
- iftrue
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.
-
-
Method Details
-
getModifiedResource
Description copied from class:ResourceChange
Returns the resource of this change.- Specified by:
getModifiedResource
in classResourceChange
- Returns:
- the resource of this change
-
getName
Description copied from class:Change
Returns the human readable name of this change. The name MUST not benull
. -
perform
Description copied from class:Change
Performs this change. If this method is called on an invalid or disabled change object the result is unspecified. Changes should in general not respond toIProgressMonitor.isCanceled()
since canceling a change tree in the middle of its execution leaves the workspace in a half changed state.- Specified by:
perform
in classChange
- Parameters:
pm
- a progress monitor- Returns:
- the undo change for this change object or
null
if no undo is provided - Throws:
CoreException
- if an error occurred during change execution
-
getDescriptor
Description copied from class:Change
Returns a descriptor of this change.Subclasses of changes created by
Refactoring.createChange(IProgressMonitor)
should override this method to return aRefactoringChangeDescriptor
. 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 ofCompositeChange
in theirRefactoring.createChange(IProgressMonitor)
method which implements this method. The refactoring framework searches the change tree top-down until a refactoring descriptor is found.- Overrides:
getDescriptor
in classChange
- Returns:
- a descriptor of this change, or
null
if this change does not provide a change descriptor.
-
setDescriptor
Sets the change descriptor to be returned byChange.getDescriptor()
.- Parameters:
descriptor
- the change descriptor
-