Composite Refactoring
v1.0

compositeRefactoring.changes
Class CreateAbstractClassChange

java.lang.Object
  |
  +--org.eclipse.jdt.internal.corext.refactoring.base.Change
        |
        +--compositeRefactoring.changes.CreateAbstractClassChange
All Implemented Interfaces:
IChange

public class CreateAbstractClassChange
extends Change
implements IChange

This class represents an IChange for the refactoring CreateAbstractClassRefactoring. It is created when the method CreateAbstractClassRefactoring.createChange(IProgressMonitor pm) is called. An abstract class will be created an formatted. It is saved in a compilation unit which is stored in a parent Package.


Fields inherited from interface org.eclipse.jdt.internal.corext.refactoring.base.IChange
REFACTORING_CHANGE_ABORTED
 
Constructor Summary
CreateAbstractClassChange(IPackageFragment parentElement, String className)
          creates a new CreateAbstractClassChange object.
 
Method Summary
 Object getModifiedLanguageElement()
          gets the modified language element.
 String getName()
          gets the name of this change.
 ICompilationUnit getNewCompilationUnit()
          gets the new created .java-file.
 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

CreateAbstractClassChange

public CreateAbstractClassChange(IPackageFragment parentElement,
                                 String className)
creates a new CreateAbstractClassChange object.
Parameters:
parentElement - the Package in which the new class is to be created.
className - the name of the abstract class.
Method Detail

perform

public void perform(ChangeContext context,
                    IProgressMonitor pm)
             throws JavaModelException,
                    ChangeAbortException
performs the change. When this method is called, a .java-file is created and stored on the filesystem. Its content is "public abstract class 'className' {}".
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 deletes the created abstract class.
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 a package.
Specified by:
getModifiedLanguageElement in interface IChange
Returns:
the modified language element.

getNewCompilationUnit

public ICompilationUnit getNewCompilationUnit()
gets the new created .java-file.
Returns:
the compilation unit representing the .java-file.

Composite Refactoring
v1.0