Composite Refactoring
v1.0

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...


Fields inherited from interface org.eclipse.jdt.internal.corext.refactoring.base.IChange
REFACTORING_CHANGE_ABORTED
 
Constructor Summary
InheritChange(ICompilationUnit base, ICompilationUnit derived, Inherit inherit)
          creates an InheritChange object.
 
Method Summary
 Object getModifiedLanguageElement()
          gets the modified language element.
 String getName()
          gets the name of this change.
 IChange getUndoChange()
          gets the undo change.
 void perform(ChangeContext context, IProgressMonitor pm)
          performs the change.
 
Methods inherited from class org.eclipse.jdt.internal.corext.refactoring.base.Change
aboutToPerform, checkIfModifiable, checkIfModifiable, handleException, handleJavaModelException, isActive, isUndoable, performed, setActive, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jdt.internal.corext.refactoring.base.IChange
aboutToPerform, isActive, isUndoable, performed, setActive
 

Constructor Detail

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.
Method Detail

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 performed
pm - 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.

Composite Refactoring
v1.0