|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.core.runtime.PlatformObject org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant org.eclipse.ltk.core.refactoring.participants.RenameParticipant org.eclipse.xtext.ui.refactoring.impl.AbstractProcessorBasedRenameParticipant
public abstract class AbstractProcessorBasedRenameParticipant
Constructor Summary | |
---|---|
AbstractProcessorBasedRenameParticipant()
|
Method Summary | |
---|---|
org.eclipse.ltk.core.refactoring.RefactoringStatus |
checkConditions(org.eclipse.core.runtime.IProgressMonitor pm,
org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext context)
Checks the conditions of the refactoring participant. |
org.eclipse.ltk.core.refactoring.Change |
createChange(org.eclipse.core.runtime.IProgressMonitor pm)
Creates a Change object that contains the workspace modifications
of this participant to be executed after the
changes from the refactoring are executed. |
protected java.util.List<? extends IRenameElementContext> |
createRenameElementContexts(java.lang.Object element)
|
protected IGlobalServiceProvider |
getGlobalServiceProvider()
|
java.lang.String |
getName()
Returns a human readable name of this participant. |
protected java.lang.String |
getNewName()
|
protected abstract java.util.List<org.eclipse.emf.ecore.EObject> |
getRenamedElementsOrProxies(org.eclipse.emf.ecore.EObject originalTarget)
|
protected java.util.List<IRenameProcessorAdapter> |
getRenameProcessors(java.lang.Object element)
|
protected IRenameRefactoringProvider |
getRenameRefactoringProvider(IRenameElementContext renameElementContext)
|
protected org.eclipse.ltk.core.refactoring.RefactoringStatus |
getStatus()
|
protected boolean |
initialize(java.lang.Object element)
Initializes the participant with the element to be refactored. |
Methods inherited from class org.eclipse.ltk.core.refactoring.participants.RenameParticipant |
---|
getArguments, initialize |
Methods inherited from class org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant |
---|
createPreChange, getProcessor, getTextChange, initialize |
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 AbstractProcessorBasedRenameParticipant()
Method Detail |
---|
protected boolean initialize(java.lang.Object element)
org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
false
then the framework
will consider the participant as not being initialized and the
participant will be dropped by the framework.
initialize
in class org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
element
- the element to be refactored
true
if the participant could be initialized;
otherwise false
is returned.protected java.util.List<IRenameProcessorAdapter> getRenameProcessors(java.lang.Object element)
protected IRenameRefactoringProvider getRenameRefactoringProvider(IRenameElementContext renameElementContext)
public java.lang.String getName()
org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
getName
in class org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
public org.eclipse.ltk.core.refactoring.RefactoringStatus checkConditions(org.eclipse.core.runtime.IProgressMonitor pm, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext context) throws org.eclipse.core.runtime.OperationCanceledException
org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
The refactoring is considered as not being executable if the returned status
has the severity of RefactoringStatus#FATAL
. Note that this blocks
the whole refactoring operation!
Clients should use the passed CheckConditionsContext
to validate the changes
they generate. If the generated changes include workspace resource modifications,
clients should call ...
(ResourceChangeChecker) context.getChecker(ResourceChangeChecker.class); IResourceChangeDescriptionFactory deltaFactory= checker.getDeltaFactory();... and use the delta factory to describe all resource modifications in advance.
This method can be called more than once.
checkConditions
in class org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
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 canceledRefactoring.checkInitialConditions(IProgressMonitor)
,
RefactoringStatus
public org.eclipse.ltk.core.refactoring.Change createChange(org.eclipse.core.runtime.IProgressMonitor pm) throws org.eclipse.core.runtime.CoreException, org.eclipse.core.runtime.OperationCanceledException
org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
Change
object that contains the workspace modifications
of this participant to be executed after the
changes from the refactoring are executed. Note that this implies that the
undo change of the returned Change object will be executed before
the undo changes from the refactoring have been executed.
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.
As of 3.1, a participant can manipulate text resources already manipulated by
the processor as long as the textual manipulations don't conflict (i.e.
the participant manipulates a different region of the text resource).
The method must not return those changes in its change tree since the change
is already part of another change tree. If the participant only manipulates
shared changes, then it can return null
to indicate that it didn't
create own changes. A shared text change can be accessed via the method
RefactoringParticipant.getTextChange(Object)
.
createChange
in class org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant
pm
- a progress monitor to report progress
null
if no changes are made
org.eclipse.core.runtime.CoreException
- if an error occurred while creating the change
org.eclipse.core.runtime.OperationCanceledException
- if the change creation got canceledRefactoringParticipant.createPreChange(IProgressMonitor)
protected java.util.List<? extends IRenameElementContext> createRenameElementContexts(java.lang.Object element)
protected abstract java.util.List<org.eclipse.emf.ecore.EObject> getRenamedElementsOrProxies(org.eclipse.emf.ecore.EObject originalTarget)
protected java.lang.String getNewName()
protected org.eclipse.ltk.core.refactoring.RefactoringStatus getStatus()
protected IGlobalServiceProvider getGlobalServiceProvider()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |