org.eclipse.xtext.ui.refactoring.impl
Class RenameElementProcessor

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
          extended by org.eclipse.ltk.core.refactoring.participants.RenameProcessor
              extended by org.eclipse.xtext.ui.refactoring.impl.AbstractRenameProcessor
                  extended by org.eclipse.xtext.ui.refactoring.impl.RenameElementProcessor
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable
Direct Known Subclasses:
CombinedJvmJdtRenameProcessor, JdtRenameRefactoringParticipantProcessor, JvmMemberRenameProcessor, XtendRenameElementProcessor

public class RenameElementProcessor
extends AbstractRenameProcessor

LTK RefactoringProcessor for an Xtext element rename refactoring.

Author:
Jan Koehnlein - Initial contribution and API, Holger Schill

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)
           
 org.eclipse.ltk.core.refactoring.RefactoringStatus checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor pm)
           
 org.eclipse.ltk.core.refactoring.Change createChange(org.eclipse.core.runtime.IProgressMonitor monitor)
           
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()
           
 java.lang.String getIdentifier()
           
protected  java.lang.String getLanguageName()
           
 java.lang.String getNewName()
           
 java.lang.String getOriginalName()
           
 java.lang.String getProcessorName()
           
protected  ElementRenameArguments getRenameArguments()
           
 IRenameElementContext getRenameElementContext()
           
 IRenameStrategy getRenameElementStrategy()
           
protected  org.eclipse.emf.ecore.resource.ResourceSet getResourceSet(IRenameElementContext renameElementContext)
           
protected  RefactoringResourceSetProvider getResourceSetProvider()
           
 com.google.inject.Provider<StatusWrapper> getStatusProvider()
           
protected  org.eclipse.emf.ecore.EObject getTargetElement()
           
protected  void handleException(java.lang.Exception exc, StatusWrapper status)
           
 boolean initialize(IRenameElementContext renameElementContext)
           
 boolean isApplicable()
           
protected  boolean isValidTargetFile(org.eclipse.emf.ecore.resource.Resource resource, StatusWrapper status)
           
 org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant[] loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus status, org.eclipse.ltk.core.refactoring.participants.SharableParticipants sharedParticipants)
           
 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

LOG

protected static final org.apache.log4j.Logger LOG
Constructor Detail

RenameElementProcessor

public RenameElementProcessor()
Method Detail

initialize

public boolean initialize(IRenameElementContext renameElementContext)
Specified by:
initialize in class AbstractRenameProcessor

getResourceSet

protected org.eclipse.emf.ecore.resource.ResourceSet getResourceSet(IRenameElementContext renameElementContext)

createResourceSet

protected org.eclipse.emf.ecore.resource.ResourceSet createResourceSet(IRenameElementContext renameElementContext)

isValidTargetFile

protected boolean isValidTargetFile(org.eclipse.emf.ecore.resource.Resource resource,
                                    StatusWrapper status)

createRenameElementStrategy

protected IRenameStrategy createRenameElementStrategy(org.eclipse.emf.ecore.EObject targetElement,
                                                      IRenameElementContext renameElementContext)

getRenameElementStrategy

public IRenameStrategy getRenameElementStrategy()

getElements

public java.lang.Object[] getElements()
Specified by:
getElements in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor

getOriginalName

public java.lang.String getOriginalName()
Specified by:
getOriginalName in class AbstractRenameProcessor

validateNewName

public org.eclipse.ltk.core.refactoring.RefactoringStatus validateNewName(java.lang.String newName)
Specified by:
validateNewName in class AbstractRenameProcessor

getLanguageName

protected java.lang.String getLanguageName()

getIdentifier

public java.lang.String getIdentifier()
Specified by:
getIdentifier in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor

getProcessorName

public java.lang.String getProcessorName()
Specified by:
getProcessorName in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor

isApplicable

public boolean isApplicable()
                     throws org.eclipse.core.runtime.CoreException
Specified by:
isApplicable in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
Throws:
org.eclipse.core.runtime.CoreException

setNewName

public void setNewName(java.lang.String newName)
Specified by:
setNewName in class AbstractRenameProcessor

getNewName

public java.lang.String getNewName()
Specified by:
getNewName in class AbstractRenameProcessor

checkInitialConditions

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
Specified by:
checkInitialConditions in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
Throws:
org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.OperationCanceledException

checkFinalConditions

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
Specified by:
checkFinalConditions in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
Throws:
org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.OperationCanceledException

createChange

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
Specified by:
createChange in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
Throws:
org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.OperationCanceledException

loadParticipants

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
Specified by:
loadParticipants in class org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor
Throws:
org.eclipse.core.runtime.CoreException

handleException

protected void handleException(java.lang.Exception exc,
                               StatusWrapper status)

getRenameElementContext

public IRenameElementContext getRenameElementContext()

getResourceSetProvider

protected RefactoringResourceSetProvider getResourceSetProvider()

getRenameArguments

protected ElementRenameArguments getRenameArguments()

getTargetElement

protected org.eclipse.emf.ecore.EObject getTargetElement()

getStatusProvider

public com.google.inject.Provider<StatusWrapper> getStatusProvider()