compositeRefactoring.changes
Class InheritChange
java.lang.Object
|
+--org.eclipse.jdt.internal.corext.refactoring.base.Change
|
+--compositeRefactoring.changes.InheritChange
- All Implemented Interfaces:
- IChange
- public class InheritChange
- extends Change
- implements IChange
This class represents an IChange for the refactoring InheritRefactoring.
It is created when the method InheritRefactoring.createChange(IProgressMonitor pm) is called.
The superclass of Base is set to Derived. The codetransformation is
...class base extends Derived...
InheritChange
public InheritChange(ICompilationUnit base,
ICompilationUnit derived,
Inherit inherit)
- creates an InheritChange object.
- Parameters:
base
- the compilation unit to inherit.derived
- the compilation unit to be inherited from.inherit
- the Inherit object for core operations.
perform
public void perform(ChangeContext context,
IProgressMonitor pm)
throws JavaModelException,
ChangeAbortException
- performs the change. After this method is called, base extends derived.
- Specified by:
perform
in interface IChange
- Parameters:
context
- the change context in which the change is performedpm
- a progress monitor tracking the changes.
getUndoChange
public IChange getUndoChange()
- gets the undo change. The undo change changes the superclass of Base to the original one or to null
if Base inherits from java.lang.Object.
- Specified by:
getUndoChange
in interface IChange
- Returns:
- the undo change.
getName
public String getName()
- gets the name of this change.
- Specified by:
getName
in interface IChange
- Following copied from interface:
org.eclipse.jdt.internal.corext.refactoring.base.IChange
- Returns:
- the change's name.
getModifiedLanguageElement
public Object getModifiedLanguageElement()
- gets the modified language element. In this case, the modified language element is the base class
which inherits from the derived class.
- Specified by:
getModifiedLanguageElement
in interface IChange
- Returns:
- the modified language element.