|
|||||||||
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.RefactoringProcessor org.eclipse.ltk.core.refactoring.participants.RenameProcessor org.eclipse.xtext.ui.refactoring.impl.AbstractRenameProcessor org.eclipse.xtext.ui.refactoring.impl.RenameElementProcessor
public class RenameElementProcessor
LTK RefactoringProcessor
for an Xtext element rename
refactoring.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.xtext.ui.refactoring.IRenameProcessorAdapter |
---|
IRenameProcessorAdapter.DefaultFactory, IRenameProcessorAdapter.Factory |
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
LOG
|
Constructor Summary | |
---|---|
RenameElementProcessor()
|
Method Summary | |
---|---|
org.eclipse.ltk.core.refactoring.RefactoringStatus |
checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext context)
Checks the final conditions based on the element to be refactored. |
org.eclipse.ltk.core.refactoring.RefactoringStatus |
checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor pm)
Checks some initial conditions based on the element to be refactored. |
protected void |
checkTargetFile(org.eclipse.emf.ecore.resource.Resource resource)
|
org.eclipse.ltk.core.refactoring.Change |
createChange(org.eclipse.core.runtime.IProgressMonitor monitor)
Creates a Change object describing the workspace modifications
the processor contributes to the overall refactoring. |
protected IRenameStrategy |
createRenameElementStrategy(org.eclipse.emf.ecore.EObject targetElement,
IRenameElementContext renameElementContext)
|
protected org.eclipse.emf.ecore.resource.ResourceSet |
createResourceSet(IRenameElementContext renameElementContext)
|
java.lang.Object[] |
getElements()
Returns an array containing the elements to be refactored. |
java.lang.String |
getIdentifier()
Returns the unique identifier of the refactoring processor. |
protected java.lang.String |
getLanguageName()
|
java.lang.String |
getNewName()
|
java.lang.String |
getOriginalName()
|
java.lang.String |
getProcessorName()
Returns a human readable name. |
IRenameStrategy |
getRenameElementStrategy()
|
protected RefactoringResourceSetProvider |
getResourceSetProvider()
|
void |
handleException(org.eclipse.ltk.core.refactoring.RefactoringStatus status,
java.lang.Exception exc)
|
boolean |
initialize(IRenameElementContext renameElementContext)
|
boolean |
isApplicable()
Checks whether the processor is applicable to the elements to be refactored or not. |
org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant[] |
loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus status,
org.eclipse.ltk.core.refactoring.participants.SharableParticipants sharedParticipants)
Returns the array of participants. |
void |
setNewName(java.lang.String newName)
|
org.eclipse.ltk.core.refactoring.RefactoringStatus |
validateNewName(java.lang.String newName)
|
Methods inherited from class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor |
---|
getRefactoring, postCreateChange |
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 |
Field Detail |
---|
protected static final org.apache.log4j.Logger LOG
Constructor Detail |
---|
public RenameElementProcessor()
Method Detail |
---|
public boolean initialize(IRenameElementContext renameElementContext)
initialize
in class AbstractRenameProcessor
protected org.eclipse.emf.ecore.resource.ResourceSet createResourceSet(IRenameElementContext renameElementContext)
protected void checkTargetFile(org.eclipse.emf.ecore.resource.Resource resource)
protected IRenameStrategy createRenameElementStrategy(org.eclipse.emf.ecore.EObject targetElement, IRenameElementContext renameElementContext)
public IRenameStrategy getRenameElementStrategy()
getRenameElementStrategy
in class AbstractRenameProcessor
public java.lang.Object[] getElements()
org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
getElements
in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
public java.lang.String getOriginalName()
public org.eclipse.ltk.core.refactoring.RefactoringStatus validateNewName(java.lang.String newName)
protected java.lang.String getLanguageName()
public java.lang.String getIdentifier()
org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
null
.
getIdentifier
in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
public java.lang.String getProcessorName()
org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
null
.
getProcessorName
in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
public boolean isApplicable() throws org.eclipse.core.runtime.CoreException
org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
false
is returned the processor is
interpreted to be unusable.
isApplicable
in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
true
if the processor is applicable to the
elements; otherwise false
is returned.
org.eclipse.core.runtime.CoreException
- is the test fails. The processor is treated as
unusable if this method throws an exceptionpublic void setNewName(java.lang.String newName)
setNewName
in interface IRenameProcessorAdapter
setNewName
in class AbstractRenameProcessor
public java.lang.String getNewName()
getNewName
in interface IRenameProcessorAdapter
getNewName
in class AbstractRenameProcessor
public org.eclipse.ltk.core.refactoring.RefactoringStatus checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor pm) throws org.eclipse.core.runtime.CoreException, org.eclipse.core.runtime.OperationCanceledException
org.eclipse.ltk.core.refactoring.participants.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 interface IRenameProcessorAdapter
checkInitialConditions
in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
pm
- 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.
org.eclipse.core.runtime.CoreException
- if an exception occurred during initial condition
checking. If this happens, the initial condition checking is
interpreted as failed.
org.eclipse.core.runtime.OperationCanceledException
- if the condition checking got canceledRefactoring.checkInitialConditions(IProgressMonitor)
,
RefactoringStatus.FATAL
public org.eclipse.ltk.core.refactoring.RefactoringStatus checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext context) throws org.eclipse.core.runtime.CoreException, org.eclipse.core.runtime.OperationCanceledException
org.eclipse.ltk.core.refactoring.participants.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 interface IRenameProcessorAdapter
checkFinalConditions
in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
monitor
- 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.CoreException
- if an exception occurred during final condition
checking. If this happens, the final condition checking is interpreted as failed.
org.eclipse.core.runtime.OperationCanceledException
- if the condition checking got canceledRefactoring.checkFinalConditions(IProgressMonitor)
,
RefactoringStatus.FATAL
public org.eclipse.ltk.core.refactoring.Change createChange(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException, org.eclipse.core.runtime.OperationCanceledException
org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
Change
object describing the workspace modifications
the processor contributes to the overall refactoring.
createChange
in interface IRenameProcessorAdapter
createChange
in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
monitor
- 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 canceledRefactoring.createChange(IProgressMonitor)
public org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant[] loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus status, org.eclipse.ltk.core.refactoring.participants.SharableParticipants sharedParticipants) throws org.eclipse.core.runtime.CoreException
org.eclipse.ltk.core.refactoring.participants.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 org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
status
- 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 loaded
org.eclipse.core.runtime.CoreException
- if creating or loading of the participants failedISharableParticipant
public void handleException(org.eclipse.ltk.core.refactoring.RefactoringStatus status, java.lang.Exception exc)
protected RefactoringResourceSetProvider getResourceSetProvider()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |