Class DeleteResourcesDescriptor
- All Implemented Interfaces:
Comparable<RefactoringDescriptor>
An instance of this refactoring descriptor may be obtained by calling
RefactoringContribution.createDescriptor() on a refactoring
contribution requested by invoking
RefactoringCore.getRefactoringContribution(String) with the
refactoring id (ID).
Note: this class is not intended to be subclassed or instantiated by clients.
- Since:
- 3.4
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringRefactoring id of the 'Delete Resources' refactoring (value:org.eclipse.ltk.core.refactoring.delete.resources).Fields inherited from class org.eclipse.ltk.core.refactoring.RefactoringDescriptor
BREAKING_CHANGE, ID_UNKNOWN, MULTI_CHANGE, NONE, STRUCTURAL_CHANGE, USER_CHANGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRefactoring(RefactoringStatus status) Creates the a new refactoring instance for this refactoring descriptor.IPath[]The resource paths to delete.booleantrueis returned if projects contents are also deleted.voidsetDeleteContents(boolean deleteContents) If set totrue, delete will also delete project contents.voidsetResourcePaths(IPath[] resourcePath) The paths to the resources to be deleted.voidsetResources(IResource[] resources) The resources to be deleted.Methods inherited from class org.eclipse.ltk.core.refactoring.RefactoringDescriptor
compareTo, createRefactoringContext, equals, getComment, getDescription, getFlags, getID, getProject, getTimeStamp, hashCode, setComment, setDescription, setFlags, setProject, setTimeStamp, toString
-
Field Details
-
ID
Refactoring id of the 'Delete Resources' refactoring (value:org.eclipse.ltk.core.refactoring.delete.resources).Clients may safely cast the obtained refactoring descriptor to
DeleteResourcesDescriptor.- See Also:
-
-
Constructor Details
-
DeleteResourcesDescriptor
public DeleteResourcesDescriptor()Creates a new refactoring descriptor.Clients should not instantiated this class but use
RefactoringCore.getRefactoringContribution(String)withIDto get the contribution that can create the descriptor.
-
-
Method Details
-
getResourcePaths
The resource paths to delete.- Returns:
- an array of IPaths.
-
setResourcePaths
The paths to the resources to be deleted. The resources can beIProjector a mixture ofIFileandIFolder.- Parameters:
resourcePath- paths of the resources to be deleted
-
setResources
- Parameters:
resources- IResources to be deleted
-
isDeleteContents
public boolean isDeleteContents()trueis returned if projects contents are also deleted.- Returns:
trueif this will delete the project contents. The content delete is not undoable.
-
setDeleteContents
public void setDeleteContents(boolean deleteContents) If set totrue, delete will also delete project contents.- Parameters:
deleteContents-trueif this will delete the project contents. The content delete is not undoable.
-
createRefactoring
Description copied from class:RefactoringDescriptorCreates the a new refactoring instance for this refactoring descriptor.The returned refactoring must be in an initialized state, i.e. ready to be executed via
PerformRefactoringOperation.This method is not intended to be called directly from code that does not belong to this class and its subclasses. External code should call
RefactoringDescriptor.createRefactoringContext(RefactoringStatus)and obtain the refactoring object from the refactoring context.- Specified by:
createRefactoringin classRefactoringDescriptor- Parameters:
status- a refactoring status used to describe the outcome of the initialization- Returns:
- the refactoring, or
nullif this refactoring descriptor represents the unknown refactoring, or if no refactoring contribution is available for this refactoring descriptor which is capable to create a refactoring - Throws:
CoreException- if an error occurs while creating the refactoring instance
-