public final class RenameResourceDescriptor extends 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.
Modifier and Type | Field and Description |
---|---|
static String |
ID
Refactoring id of the 'Rename Resource' refactoring (value:
org.eclipse.ltk.core.refactoring.rename.resource ). |
BREAKING_CHANGE, ID_UNKNOWN, MULTI_CHANGE, NONE, STRUCTURAL_CHANGE, USER_CHANGE
Constructor and Description |
---|
RenameResourceDescriptor()
Creates a new refactoring descriptor.
|
Modifier and Type | Method and Description |
---|---|
Refactoring |
createRefactoring(RefactoringStatus status)
Creates the a new refactoring instance for this refactoring descriptor.
|
String |
getNewName()
Returns the new name to rename the resource to.
|
IPath |
getResourcePath()
Returns the path of the resource to rename.
|
boolean |
isUpdateReferences()
Returns if this rename will also update references
|
void |
setNewName(String name)
Sets the new name to rename the resource to.
|
void |
setProject(String project)
Sets the project name of this refactoring.
|
void |
setResourcePath(IPath resourcePath)
Sets the resource to be renamed.
|
void |
setUpdateReferences(boolean updateReferences)
If set to
true , this rename will also update references. |
compareTo, createRefactoringContext, equals, getComment, getDescription, getFlags, getID, getProject, getTimeStamp, hashCode, setComment, setDescription, setFlags, setTimeStamp, toString
public static final String ID
org.eclipse.ltk.core.refactoring.rename.resource
).
Clients may safely cast the obtained refactoring descriptor to
RenameResourceDescriptor
.
public RenameResourceDescriptor()
Clients should not instantiated this class but use RefactoringCore.getRefactoringContribution(String)
with ID
to get the contribution that can create the descriptor.
public void setNewName(String name)
name
- the non-empty new name to setpublic String getNewName()
public void setProject(String project)
Note: If the resource to be renamed is of type IResource.PROJECT
,
clients are required to to set the project name to null
.
The default is to associate the refactoring with the workspace.
setProject
in class RefactoringDescriptor
project
- the non-empty project name to set, or null
for
the workspaceRefactoringDescriptor.getProject()
public void setResourcePath(IPath resourcePath)
Note: If the resource to be renamed is of type IResource.PROJECT
,
clients are required to to set the project name to null
.
resourcePath
- the resource to be renamedpublic IPath getResourcePath()
public void setUpdateReferences(boolean updateReferences)
true
, this rename will also update references. The default is to update references.updateReferences
- true
if this rename will update referencespublic boolean isUpdateReferences()
true
if this rename will update referencespublic Refactoring createRefactoring(RefactoringStatus status) throws CoreException
RefactoringDescriptor
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.
createRefactoring
in class RefactoringDescriptor
status
- a refactoring status used to describe the outcome of the initializationnull
if this refactoring
descriptor represents the unknown refactoring, or if no
refactoring contribution is available for this refactoring
descriptor which is capable to create a refactoringCoreException
- if an error occurs while creating the refactoring instance
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.