Composite Refactoring
v1.0

compositeRefactoring.refactoringComposite
Class RefactoringNode

java.lang.Object
  |
  +--compositeRefactoring.refactoringComposite.RefactoringComponent
        |
        +--compositeRefactoring.refactoringComposite.RefactoringNode
All Implemented Interfaces:
IRefactoring

public class RefactoringNode
extends RefactoringComponent
implements IRefactoring

A RefactoringNode is a representation of a single refactoring. This is a wrapper class for Types of the class Refactoring. It implements the interface IRefactoring and, thus, has all methods on which Refactorings can operate. Additionally, there are the inherited methods refactor() and undo() for executing and undoing the Refactoring without taking care of further delegations like IChange or core classes.


Fields inherited from class compositeRefactoring.refactoringComposite.RefactoringComponent
fName
 
Constructor Summary
RefactoringNode(Refactoring ref)
          creates a new RefactoringNode component
 
Method Summary
 RefactoringStatus checkPreconditions(IProgressMonitor pm)
          checks the Preconditions of the refactoring.
 IChange createChange(IProgressMonitor pm)
          creates the change which is to be executed when performing the refactoring.
 Refactoring getRefactoring()
          gets the Refactoring object of the RefactoringNode.
 RefactoringStatus refactor()
          this method performs the single refactoring.
 void setCheckedPassedSeverity(int i)
          sets the severity of the refactoring, that is the tolerance of errors which can be passed. possible severity levels are: RefactoringStatus.ERROR: an error as created by a compiler RefactoringStatus.INFO: neither error nor warning.
 RefactoringStatus undo()
          this method undos the single refactoring when it was performed.
 
Methods inherited from class compositeRefactoring.refactoringComposite.RefactoringComponent
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jdt.internal.corext.refactoring.base.IRefactoring
getName
 

Constructor Detail

RefactoringNode

public RefactoringNode(Refactoring ref)
creates a new RefactoringNode component
Parameters:
ref - the refactoring object with which the transforamtion can be made.
Method Detail

checkPreconditions

public RefactoringStatus checkPreconditions(IProgressMonitor pm)
                                     throws JavaModelException
checks the Preconditions of the refactoring. After performing some initial checks, the method delegates to the actual refactoring object surrounded by this class.
Specified by:
checkPreconditions in interface IRefactoring
Overrides:
checkPreconditions in class RefactoringComponent
Parameters:
pm - an IProgressMonitor to monitor the method's progress
Returns:
the status of the checks.

createChange

public IChange createChange(IProgressMonitor pm)
                     throws JavaModelException
creates the change which is to be executed when performing the refactoring. The method delegates to the actual refactoring object surrounded by this class. It is not used in the current implementation - just for extensibility.
Specified by:
createChange in interface IRefactoring
Overrides:
createChange in class RefactoringComponent
Parameters:
pm - an IProgressMonitor to monitor the method's progress
Returns:
the actual change

refactor

public RefactoringStatus refactor()
this method performs the single refactoring.
Overrides:
refactor in class RefactoringComponent
Returns:
the status of the performed refactoring

undo

public RefactoringStatus undo()
this method undos the single refactoring when it was performed.
Overrides:
undo in class RefactoringComponent
Returns:
the status of the Undo

getRefactoring

public Refactoring getRefactoring()
gets the Refactoring object of the RefactoringNode.
Returns:
the actual refactoring.

setCheckedPassedSeverity

public void setCheckedPassedSeverity(int i)
sets the severity of the refactoring, that is the tolerance of errors which can be passed. possible severity levels are:

Composite Refactoring
v1.0