Composite Refactoring
v1.0

compositeRefactoring.refactoring
Class CreateAbstractClassRefactoring

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

public class CreateAbstractClassRefactoring
extends Refactoring

This class is the representation of a refactoring performing an create abstract class transformation. The class which will be created looks something like public abstract class 'classname' {}. It is also formatted.


Constructor Summary
CreateAbstractClassRefactoring(IPackageFragment pack, String name)
          creates a CreateAbstracClassRefactoring.
 
Method Summary
 RefactoringStatus checkActivation(IProgressMonitor pm)
          checks if there is a package in which the class can be created.
 RefactoringStatus checkInput(IProgressMonitor pm)
          checks if there is already a class in the package with this class's name.
 IChange createChange(IProgressMonitor pm)
          creates the change object for this refactoring.
 String getName()
          gets the name of the refactoring.
 ICompilationUnit getNewCompilationUnit()
          gets the new created compilation unit (the .java-file).
 
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
 

Constructor Detail

CreateAbstractClassRefactoring

public CreateAbstractClassRefactoring(IPackageFragment pack,
                                      String name)
creates a CreateAbstracClassRefactoring.
Parameters:
pack - the package in which the class (that is the compilation unit) is to be created.
name - the name of the new abstract class.
Method Detail

checkActivation

public RefactoringStatus checkActivation(IProgressMonitor pm)
                                  throws JavaModelException
checks if there is a package in which the class can be created.
Overrides:
checkActivation in class Refactoring
Parameters:
pm - the progress monitor which tracks the check.
Returns:
the status of the check.

checkInput

public RefactoringStatus checkInput(IProgressMonitor pm)
                             throws JavaModelException
checks if there is already a class in the package with this class's name.
Overrides:
checkInput in class Refactoring
Parameters:
pm - the progress monitor which tracks the check.
Returns:
the status of the check.

createChange

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

getName

public String getName()
gets the name of the refactoring.
Returns:
the name of the refactoring.

getNewCompilationUnit

public ICompilationUnit getNewCompilationUnit()
gets the new created compilation unit (the .java-file). It can be obtained for passing it to other refactorings.
Returns:
the new created compilation unit.

Composite Refactoring
v1.0