Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2011 itemis AG ( and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at /
 package org.eclipse.xtext.ui.refactoring.impl;
import  org.eclipse.ltk.core.refactoring.RefactoringStatus;
Base class for all IRenameStrategy implementations. Performs the declaration updates on a semantic EMF model.

Jan Koehnlein - Initial contribution and API
	public boolean initialize(EObject targetElementIRenameElementContext context) {
		this. = getNameAttribute(targetElement);
		if( == null)
			return false;
		this. = EcoreUtil.getURI(targetElement);
		this. = targetElement.eGet().toString();
		return !Strings.isEmpty();
	public String getOriginalName() {
		return ;
	public RefactoringStatus validateNewName(String newName) {
		RefactoringStatus status = new RefactoringStatus();
		return status;
	public void applyDeclarationChange(String newNameResourceSet resourceSet) {
		EObject renamedElement = setName(newNameresourceSet);
		 = EcoreUtil.getURI(renamedElement);
	public void revertDeclarationChange(ResourceSet resourceSet) {
		if ( == null)
	protected EObject setName(URI targetElementURIString newNameResourceSet resourceSet) {
		EObject targetElement = resourceSet.getEObject(targetElementURIfalse);
		if (targetElement == null) {
			throw new RefactoringException("Target element not loaded.");
		return targetElement;
	protected URI getTargetElementNewURI() {
	protected EAttribute getNameAttribute(EObject targetElement) {
	protected EAttribute getNameAttribute() {
		return ;
New to GrepCode? Check out our FAQ X