|
Eclipse Platform Release 3.7 |
|||||||||
| 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.NullChange
public class NullChange
A refactoring change that does nothing. The reverse change of a
NullChange is a NullChange.
Note: this class is not intended to be extended by clients.
| Constructor Summary | |
|---|---|
NullChange()
Creates a new NullChange with a default name. |
|
NullChange(String name)
Creates a new NullChange with the given name. |
|
| Method Summary | |
|---|---|
Object |
getModifiedElement()
Returns the element modified by this Change. |
String |
getName()
Returns the human readable name of this change. |
void |
initializeValidationData(IProgressMonitor pm)
Hook method to initialize some internal state to provide an adequate answer for the isValid method. |
RefactoringStatus |
isValid(IProgressMonitor pm)
Verifies that this change object is still valid and can be executed by calling perform. |
Change |
perform(IProgressMonitor pm)
Performs this change. |
| Methods inherited from class org.eclipse.ltk.core.refactoring.Change |
|---|
dispose, getAdapter, getAffectedObjects, getDescriptor, getParent, isEnabled, setEnabled, setEnabledShallow |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NullChange()
NullChange with a default name.
public NullChange(String name)
NullChange with the given name.
name - the human readable name of this change| Method Detail |
|---|
public String getName()
null.
getName in class Changepublic void initializeValidationData(IProgressMonitor pm)
isValid method. This method gets called after a change
or a whole change tree has been created.
Typically this method is implemented in one of the following ways:
dispose.isValid is called.
For example, a change object that manipulates the content of an IFile
could either listen to resource changes and detect that the file got changed or
it could remember some content stamp and compare it with the actual content stamp
when isValid is called.
initializeValidationData in class Changepm - a progress monitor
public RefactoringStatus isValid(IProgressMonitor pm)
throws CoreException
perform. If a refactoring status with a severity of RefactoringStatus.FATAL is returned then the change has to be treated as invalid
and can no longer be executed. Performing such a change produces an unspecified
result and will very likely throw an exception.
This method is also called by the UndoManager to decide if
an undo or redo change is still valid and therefore can be executed.
isValid in class Changepm - a progress monitor.
CoreException - if an error occurred during validation check. The change
is to be treated as invalid if an exception occurs
public Change perform(IProgressMonitor pm)
throws CoreException
IProgressMonitor.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 executionpublic Object getModifiedElement()
Change. The method may return
null if the change isn't related to an element.
getModifiedElement in class Change
|
Eclipse Platform Release 3.7 |
|||||||||
| 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, 2011. All rights reserved.