Class MoveRenameResourceDescriptor
- 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.10
- Restriction:
- This class is not intended to be instantiated by clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringRefactoring id of the 'Move/Rename Resource' refactoring (value:org.eclipse.ltk.core.refactoring.moverename.resource).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.Returns the destination container to move the resources in.Returns the new name to rename the resource to.Returns the path of the resource to rename.booleanReturns if this rename will also update referencesvoidsetDestination(IContainer container) Sets the destination container to move the resources in.voidsetDestinationPath(IPath path) Sets the path of the destination container to move the resources in.voidsetNewName(String name) Sets the new name to rename the resource to.voidsetProject(String project) Sets the project name of this refactoring.voidsetResourcePath(IPath resourcePath) Sets the resource to be renamed.voidsetUpdateReferences(boolean updateReferences) If set totrue, this rename will also update references.Methods inherited from class org.eclipse.ltk.core.refactoring.RefactoringDescriptor
compareTo, createRefactoringContext, equals, getComment, getDescription, getFlags, getID, getProject, getTimeStamp, hashCode, setComment, setDescription, setFlags, setTimeStamp, toString
-
Field Details
-
ID
Refactoring id of the 'Move/Rename Resource' refactoring (value:org.eclipse.ltk.core.refactoring.moverename.resource).Clients may safely cast the obtained refactoring descriptor to
MoveRenameResourceDescriptor.- See Also:
-
-
Constructor Details
-
MoveRenameResourceDescriptor
public MoveRenameResourceDescriptor()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
-
setNewName
Sets the new name to rename the resource to.- Parameters:
name- the non-empty new name to set
-
getNewName
Returns the new name to rename the resource to.- Returns:
- the new name to rename the resource to
-
setDestination
Sets the destination container to move the resources in.- Parameters:
container- the destination
-
setDestinationPath
Sets the path of the destination container to move the resources in.- Parameters:
path- the destination path
-
getDestinationPath
Returns the destination container to move the resources in.- Returns:
- the destination container to move the resource in
-
setProject
Sets the project name of this refactoring.Note: If the resource to be renamed is of type
IResource.PROJECT, clients are required to to set the project name tonull.The default is to associate the refactoring with the workspace.
- Overrides:
setProjectin classRefactoringDescriptor- Parameters:
project- the non-empty project name to set, ornullfor the workspace- See Also:
-
setResourcePath
Sets the resource to be renamed.Note: If the resource to be renamed is of type
IResource.PROJECT, clients are required to to set the project name tonull.- Parameters:
resourcePath- the resource to be renamed
-
getResourcePath
Returns the path of the resource to rename.- Returns:
- the path of the resource to rename
-
setUpdateReferences
public void setUpdateReferences(boolean updateReferences) If set totrue, this rename will also update references. The default is to update references.- Parameters:
updateReferences-trueif this rename will update references
-
isUpdateReferences
public boolean isUpdateReferences()Returns if this rename will also update references- Returns:
- returns
trueif this rename will update references
-
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
-