Composite Refactoring
v1.0

compositeRefactoring.refactoring
Class InheritRefactoring

java.lang.Object
  |
  +--org.eclipse.jdt.internal.corext.refactoring.base.Refactoring
        |
        +--compositeRefactoring.refactoring.InheritRefactoring
All Implemented Interfaces:
IRefactoring

public class InheritRefactoring
extends Refactoring
implements IRefactoring

This class is the representation of a refactoring performing an inheritence transformation. Base inherits from Derived. Base's superclass is changed to Derived unless one of the following enabling conditions are not fulfilled:


Constructor Summary
InheritRefactoring(ICompilationUnit base, ICompilationUnit derived)
          creates the InheritRefactoring object.
 
Method Summary
 RefactoringStatus checkActivation(IProgressMonitor pm)
          checks if the refactoring can be activated, e.g. if the vompilation units of base and derived exist, whether they are modifyable
 RefactoringStatus checkInput(IProgressMonitor pm)
          checks the enabling conditions of the inherit refactoring.
 IChange createChange(IProgressMonitor pm)
          creates the change object for this refactoring.
 String getName()
          gets the name of the refactoring.
 
Methods inherited from class org.eclipse.jdt.internal.corext.refactoring.base.Refactoring
checkPreconditions, getUndoManager, 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.IRefactoring
checkPreconditions
 

Constructor Detail

InheritRefactoring

public InheritRefactoring(ICompilationUnit base,
                          ICompilationUnit derived)
creates the InheritRefactoring object.
Parameters:
base - the subclass of the inheritence dependency
derived - the superclass of the inheritence dependency
Method Detail

checkActivation

public RefactoringStatus checkActivation(IProgressMonitor pm)
                                  throws JavaModelException
checks if the refactoring can be activated, e.g. if the vompilation units of base and derived exist, whether they are modifyable
Overrides:
checkActivation in class Refactoring
Parameters:
pm - a progress monitor tracking the check.
Returns:
the status of the check

checkInput

public RefactoringStatus checkInput(IProgressMonitor pm)
                             throws JavaModelException
checks the enabling conditions of the inherit refactoring. The conditions are
Overrides:
checkInput in class Refactoring
Following copied from class: org.eclipse.jdt.internal.corext.refactoring.base.Refactoring
See Also:
Refactoring.checkActivation(org.eclipse.core.runtime.IProgressMonitor), RefactoringStatus.isOK()

createChange

public IChange createChange(IProgressMonitor pm)
                     throws JavaModelException
creates the change object for this refactoring. The change object is the actual transformation of code.
Specified by:
createChange in interface IRefactoring
Parameters:
pm - the progress monitor tracking the change.
Returns:
the change object.

getName

public String getName()
gets the name of the refactoring.
Specified by:
getName in interface IRefactoring
Returns:
the name of the refactoring.

Composite Refactoring
v1.0