- All Implemented Interfaces:
Note: this class is not intended to be extended by clients.
- This class is not intended to be subclassed by clients.
Method SummaryModifier and TypeMethodDescriptionReturns the element modified by this
getName()Returns the human readable name of this change.
voidHook method to initialize some internal state to provide an adequate answer for the
isValidmethod.Verifies that this change object is still valid and can be executed by calling
perform.Performs this change.
Methods inherited from class org.eclipse.ltk.core.refactoring.Change
dispose, getAdapter, getAffectedObjects, getDescriptor, getParent, isEnabled, setEnabled, setEnabledShallow
NullChangepublic NullChange()Creates a new
NullChangewith a default name.
(String name)Creates a new
NullChangewith the given name.
name- the human readable name of this change
getNamepublic String getName()Returns the human readable name of this change. The name MUST not be
initializeValidationDatapublic void initializeValidationData
(IProgressMonitor pm)Hook method to initialize some internal state to provide an adequate answer for the
isValidmethod. 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:
- the change hooks up a listener on some delta notification mechanism
and marks itself as invalid if it receives a certain delta. Is this
the case the implementor must take care of unhooking the listener
- the change remembers some information allowing to decide if a change
object is still valid when
For example, a change object that manipulates the content of an
IFilecould 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
- the change hooks up a listener on some delta notification mechanism and marks itself as invalid if it receives a certain delta. Is this the case the implementor must take care of unhooking the listener in
isValidVerifies that this change object is still valid and can be executed by calling
perform. If a refactoring status with a severity of
RefactoringStatus.FATALis 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
UndoManagerto decide if an undo or redo change is still valid and therefore can be executed.
performPerforms this change. If this method is called on an invalid or disabled change object the result is unspecified. Changes should in general not respond to
IProgressMonitor.isCanceled()since canceling a change tree in the middle of its execution leaves the workspace in a half changed state.
getModifiedElementpublic Object getModifiedElement()Returns the element modified by this
Change. The method may return
nullif the change isn't related to an element.