public final class JavaCopyProcessor extends CopyProcessor implements IReorgDestinationValidator
| Constructor and Description |
|---|
JavaCopyProcessor(IReorgPolicy.ICopyPolicy copyPolicy) |
JavaCopyProcessor(JavaRefactoringArguments refactoringArguments,
RefactoringStatus status) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canChildrenBeDestinations(IReorgDestination destination)
Is it possible, that destination contains valid destinations
as children?
|
boolean |
canElementBeDestination(IReorgDestination destination)
Is it possible, that the given kind of destination is a target for
the reorg?
|
RefactoringStatus |
checkFinalConditions(IProgressMonitor pm,
CheckConditionsContext context)
Checks the final conditions based on the element to be refactored.
|
RefactoringStatus |
checkInitialConditions(IProgressMonitor pm)
Checks some initial conditions based on the element to be refactored.
|
Change |
createChange(IProgressMonitor pm)
Creates a
Change object describing the workspace modifications
the processor contributes to the overall refactoring. |
Object |
getCommonParentForInputElements() |
Object[] |
getElements()
Returns an array containing the elements to be refactored.
|
String |
getIdentifier()
Returns the unique identifier of the refactoring processor.
|
IJavaElement[] |
getJavaElements() |
String |
getProcessorName()
Returns a human readable name.
|
IResource[] |
getResources() |
int |
getSaveMode() |
boolean |
isApplicable()
Checks whether the processor is applicable to the elements to be
refactored or not.
|
RefactoringParticipant[] |
loadParticipants(RefactoringStatus status,
SharableParticipants sharedParticipants)
Returns the array of participants.
|
RefactoringStatus |
setDestination(IReorgDestination destination) |
void |
setNewNameQueries(INewNameQueries newNameQueries) |
void |
setReorgQueries(IReorgQueries queries) |
getRefactoring, postCreateChangegetAdapterpublic JavaCopyProcessor(IReorgPolicy.ICopyPolicy copyPolicy)
public JavaCopyProcessor(JavaRefactoringArguments refactoringArguments, RefactoringStatus status)
public boolean canChildrenBeDestinations(IReorgDestination destination)
IReorgDestinationValidatorcanChildrenBeDestinations in interface IReorgDestinationValidatordestination - the destination to verifypublic boolean canElementBeDestination(IReorgDestination destination)
IReorgDestinationValidatorcanElementBeDestination in interface IReorgDestinationValidatordestination - the destination to verifypublic RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException
RefactoringProcessor
The refactoring using this processor is considered as not being
executable if the returned status has the severity of
RefactoringStatus#FATAL.
This method can be called more than once.
checkFinalConditions in class RefactoringProcessorpm - a progress monitor to report progresscontext - a condition checking context to collect shared condition checksRefactoringStatus#FATAL
the refactoring is considered as not being executable.CoreException - if an exception occurred during final condition
checking. If this happens the final condition checking is interpreted as failed.Refactoring.checkFinalConditions(IProgressMonitor),
RefactoringStatus.FATALpublic RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException
RefactoringProcessor
The refactoring using this processor is considered as not being
executable if the returned status has the severity of
RefactoringStatus#FATAL.
This method can be called more than once.
checkInitialConditions in class RefactoringProcessorpm - a progress monitor to report progress. Although availability
checks are supposed to execute fast, there can be certain
situations where progress reporting is necessary. For example
rebuilding a corrupted index may report progress.RefactoringStatus#FATAL
the refactoring is considered as not being executable.CoreException - if an exception occurred during initial condition
checking. If this happens the initial condition checking is
interpreted as failed.Refactoring.checkInitialConditions(IProgressMonitor),
RefactoringStatus.FATALpublic Change createChange(IProgressMonitor pm) throws CoreException
RefactoringProcessorChange object describing the workspace modifications
the processor contributes to the overall refactoring.createChange in class RefactoringProcessorpm - a progress monitor to report progressCoreException - if an error occurred while creating the changeRefactoring.createChange(IProgressMonitor)public Object getCommonParentForInputElements()
public Object[] getElements()
RefactoringProcessorgetElements in class RefactoringProcessorpublic String getIdentifier()
RefactoringProcessornull.getIdentifier in class RefactoringProcessorpublic IJavaElement[] getJavaElements()
public String getProcessorName()
RefactoringProcessornull.getProcessorName in class RefactoringProcessorpublic IResource[] getResources()
public boolean isApplicable() throws CoreException
RefactoringProcessor false is returned the processor is
interpreted to be unusable.isApplicable in class RefactoringProcessortrue if the processor is applicable to the
elements; otherwise false is returned.CoreException - is the test fails. The processor is treated as
unusable if this method throws an exceptionpublic RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException
RefactoringProcessor
Implementors are responsible to initialize the created participants with
the right arguments. The method is called after
RefactoringProcessor.checkFinalConditions(IProgressMonitor, CheckConditionsContext)has
been called on the processor itself.
loadParticipants in class RefactoringProcessorstatus - a refactoring status to report status if problems occur while
loading the participantssharedParticipants - a list of sharable participants. Implementors of
this method can simply pass this instance to the corresponding participant
loading methods defined in ParticipantManager.null or an empty array
if no participants are loadedCoreException - if creating or loading of the participants failedISharableParticipantpublic RefactoringStatus setDestination(IReorgDestination destination) throws JavaModelException
JavaModelExceptionpublic void setNewNameQueries(INewNameQueries newNameQueries)
public void setReorgQueries(IReorgQueries queries)
public int getSaveMode()