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