|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.PlatformObject
org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
A refactoring participant can participate in the condition checking and change creation of a refactoring processor.
If the severity of the condition checking result is RefactoringStatus.FATAL
then the whole refactoring will not be carried out.
The change created from a participant MUST not conflict with any changes provided by other participants or the refactoring itself. To ensure this a participant is only allowed to manipulate resources belonging to its domain. For example a rename type participant updating launch configuration is only allowed to update launch configurations. It is not allowed to manipulate any Java resources or any other resources not belonging to its domain. If a change conflicts with another change during execution then the participant who created the change will be disabled for the rest of the eclipse session.
A refactoring participant can not assume that all resources are saved before any methods are called on it. Therefore a participant must be able to deal with unsaved resources.
This class should be subclassed by clients wishing to provide special refactoring participants extension points.
RefactoringProcessor
Constructor Summary | |
RefactoringParticipant()
|
Method Summary | |
abstract RefactoringStatus |
checkConditions(org.eclipse.core.runtime.IProgressMonitor pm,
CheckConditionsContext context)
Checks the conditions of the refactoring participant. |
abstract Change |
createChange(org.eclipse.core.runtime.IProgressMonitor pm)
Creates a Change object that contains the workspace modifications
of this participant. |
abstract String |
getName()
Returns a human readable name of this participant. |
RefactoringProcessor |
getProcessor()
Returns the processor that is associated with this participant. |
protected abstract boolean |
initialize(Object element)
Initializes the participant with the element to be refactored. |
protected abstract void |
initialize(RefactoringArguments arguments)
Initializes the participant with the refactoring arguments |
boolean |
initialize(RefactoringProcessor processor,
Object element,
RefactoringArguments arguments)
Initializes the participant. |
Methods inherited from class org.eclipse.core.runtime.PlatformObject |
getAdapter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RefactoringParticipant()
Method Detail |
public RefactoringProcessor getProcessor()
public boolean initialize(RefactoringProcessor processor, Object element, RefactoringArguments arguments)
This method isn't intended to be extended or reimplemented by clients.
processor
- the processor this participant is associated withelement
- the element to be refactoredarguments
- the refactoring arguments
true
if the participant could be initialized;
otherwise false
is returned. If false
is
returned then the participant will not be added to the refactoring.initialize(Object)
protected abstract boolean initialize(Object element)
false
then the framework
will consider the participant as not being initialized and the
participant will be dropped by the framework.
element
- the element to be refactored
true
if the participant could be initialized;
otherwise false
is returned.protected abstract void initialize(RefactoringArguments arguments)
arguments
- the refactoring argumentspublic abstract String getName()
public abstract RefactoringStatus checkConditions(org.eclipse.core.runtime.IProgressMonitor pm, CheckConditionsContext context) throws org.eclipse.core.runtime.OperationCanceledException
The refactoring is considered as not being executable if the returned status
has the severity of RefactoringStatus#FATAL
.
This method can be called more than once.
pm
- a progress monitor to report progresscontext
- a condition checking context to collect shared condition checks
RefactoringStatus#FATAL
the refactoring is considered as not being executable.
org.eclipse.core.runtime.OperationCanceledException
- if the condition checking got cancelledRefactoring.checkInitialConditions(IProgressMonitor)
,
RefactoringStatus.FATAL
public abstract Change createChange(org.eclipse.core.runtime.IProgressMonitor pm) throws org.eclipse.core.runtime.CoreException, org.eclipse.core.runtime.OperationCanceledException
Change
object that contains the workspace modifications
of this participant. The changes provided by a participant must
not conflict with any change provided by other participants or by the
refactoring itself.
If the change conflicts with any change provided by other participants or by the refactoring itself then change execution will fail and the participant will be disabled for the rest of the eclipse session.
If an exception occurs while creating the change the refactoring can not be carried out and the participant will be disabled for the rest of the eclipse session.
pm
- a progress monitor to report progress
org.eclipse.core.runtime.CoreException
- if an error occurred while creating the change
org.eclipse.core.runtime.OperationCanceledException
- if the condition checking got cancelled
|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |