|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ltk.core.refactoring.Change
org.eclipse.ltk.core.refactoring.resource.ResourceChange
org.eclipse.ltk.core.refactoring.resource.RenameResourceChange
public class RenameResourceChange
Change that renames a resource.
| 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 | |
|---|---|
|
RenameResourceChange(IPath resourcePath,
java.lang.String newName)
Creates the change. |
protected |
RenameResourceChange(IPath resourcePath,
java.lang.String newName,
long stampToRestore)
Creates the change with a time stamp to restore. |
| Method Summary | |
|---|---|
ChangeDescriptor |
getDescriptor()
Returns a descriptor of this change. |
protected IResource |
getModifiedResource()
Returns the resource of this change. |
java.lang.String |
getName()
Returns the human readable name of this change. |
java.lang.String |
getNewName()
Returns the new name. |
Change |
perform(IProgressMonitor pm)
Performs this change. |
void |
setDescriptor(ChangeDescriptor descriptor)
Sets the change descriptor to be returned by Change.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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RenameResourceChange(IPath resourcePath,
java.lang.String newName)
resourcePath - the path of the resource to renamenewName - the new name. Must not be empty.
protected RenameResourceChange(IPath resourcePath,
java.lang.String newName,
long stampToRestore)
resourcePath - the path of the resource to renamenewName - the new name. Must not be empty.stampToRestore - the time stamp to restore or IResource.NULL_STAMP to not restore the
time stamp.| Method Detail |
|---|
public 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 Changenull if this
change does not provide a change descriptor.public void setDescriptor(ChangeDescriptor descriptor)
Change.getDescriptor().
descriptor - the change descriptorprotected IResource getModifiedResource()
ResourceChange
getModifiedResource in class ResourceChangepublic java.lang.String getName()
Changenull.
getName in class Changepublic java.lang.String getNewName()
public Change perform(IProgressMonitor pm)
throws CoreException
ChangeIProgressMonitor.isCanceled() since canceling a change tree in the
middle of its execution leaves the workspace in a half changed state.
perform in class Changepm - a progress monitor
null if no
undo is provided
CoreException - if an error occurred during change execution
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.