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

java.lang.Object
  extended by org.eclipse.xtext.ui.refactoring.impl.AbstractRenameStrategy
All Implemented Interfaces:
DefaultRenameStrategyProvider.IInitializable, IRenameStrategy
Direct Known Subclasses:
DefaultRenameStrategy, EmfResourceRenameStrategy

public abstract class AbstractRenameStrategy
extends java.lang.Object
implements DefaultRenameStrategyProvider.IInitializable

Base class for all IRenameStrategy implementations. Performs the declaration updates on a semantic EMF model.

Author:
Jan Koehnlein - Initial contribution and API

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.xtext.ui.refactoring.IRenameStrategy
IRenameStrategy.Provider
 
Constructor Summary
AbstractRenameStrategy()
           
 
Method Summary
 void applyDeclarationChange(java.lang.String newName, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Applies the declaration change to the semantic model in the given resource set.
protected  org.eclipse.emf.ecore.EAttribute getNameAttribute()
           
protected  org.eclipse.emf.ecore.EAttribute getNameAttribute(org.eclipse.emf.ecore.EObject targetElement)
           
 java.lang.String getOriginalName()
           
protected  org.eclipse.emf.common.util.URI getTargetElementNewURI()
           
protected  org.eclipse.emf.common.util.URI getTargetElementOriginalURI()
           
 boolean initialize(org.eclipse.emf.ecore.EObject targetElement, IRenameElementContext context)
           
 void revertDeclarationChange(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Reverts the declaration change to the semantic model in the given resource set.
protected  org.eclipse.emf.ecore.EObject setName(org.eclipse.emf.common.util.URI targetElementURI, java.lang.String newName, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
           
 org.eclipse.ltk.core.refactoring.RefactoringStatus validateNewName(java.lang.String newName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.xtext.ui.refactoring.IRenameStrategy
createDeclarationUpdates
 

Constructor Detail

AbstractRenameStrategy

public AbstractRenameStrategy()
Method Detail

initialize

public boolean initialize(org.eclipse.emf.ecore.EObject targetElement,
                          IRenameElementContext context)
Specified by:
initialize in interface DefaultRenameStrategyProvider.IInitializable

getOriginalName

public java.lang.String getOriginalName()
Specified by:
getOriginalName in interface IRenameStrategy

validateNewName

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

applyDeclarationChange

public void applyDeclarationChange(java.lang.String newName,
                                   org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Description copied from interface: IRenameStrategy
Applies the declaration change to the semantic model in the given resource set.

Specified by:
applyDeclarationChange in interface IRenameStrategy

revertDeclarationChange

public void revertDeclarationChange(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Description copied from interface: IRenameStrategy
Reverts the declaration change to the semantic model in the given resource set.

Specified by:
revertDeclarationChange in interface IRenameStrategy

setName

protected org.eclipse.emf.ecore.EObject setName(org.eclipse.emf.common.util.URI targetElementURI,
                                                java.lang.String newName,
                                                org.eclipse.emf.ecore.resource.ResourceSet resourceSet)

getTargetElementOriginalURI

protected org.eclipse.emf.common.util.URI getTargetElementOriginalURI()

getTargetElementNewURI

protected org.eclipse.emf.common.util.URI getTargetElementNewURI()

getNameAttribute

protected org.eclipse.emf.ecore.EAttribute getNameAttribute(org.eclipse.emf.ecore.EObject targetElement)

getNameAttribute

protected org.eclipse.emf.ecore.EAttribute getNameAttribute()