Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2009 IBM Corporation 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 http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.jdt.internal.core;
This operation renames resources (Package fragments and compilation units).

Notes:

  • When a compilation unit is renamed, its main type and the constructors of the main type are renamed.
public class RenameResourceElementsOperation extends MoveResourceElementsOperation {
When executed, this operation will rename the specified elements with the given names in the corresponding destinations.
public RenameResourceElementsOperation(IJavaElement[] elementsIJavaElement[] destinationsString[] newNamesboolean force) {
	//a rename is a move to the same parent with a new name specified
	//these elements are from different parents
	super(elementsdestinationsforce);
	setRenamings(newNames);

See also:
MultiOperation
protected String getMainTaskName() {
protected boolean isRename() {
	return true;

See also:
MultiOperation
protected void verify(IJavaElement elementthrows JavaModelException {
	super.verify(element);
	int elementType = element.getElementType();
	if (!(elementType == . || elementType == .)) {
	}
	if (elementType == .) {
		if (cu.isWorkingCopy() && !cu.isPrimary()) {
		}
	}
	verifyRenaming(element);
New to GrepCode? Check out our FAQ X