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 Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.jdt.internal.core;
This operation renames elements.


  • Resource rename is not supported - this operation only renames elements contained in compilation units.
  • When a main type is renamed, its compilation unit and constructors are renamed.
  • Constructors cannot be renamed.
public class RenameElementsOperation extends MoveElementsOperation {
When executed, this operation will rename the specified elements with the given names in the corresponding destinations.
public RenameElementsOperation(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

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

See also:
protected IJavaModelStatus verify() {
	IJavaModelStatus status = super.verify();
	if (! status.isOK())
		return status;
	if (this. == null || this..length == 0)

See also:
protected void verify(IJavaElement elementthrows JavaModelException {
	if (element == null || !element.exists())
	if (element.isReadOnly())
	if (!(element instanceof ISourceReference))
	int elementType = element.getElementType();
	if (elementType < . || elementType == .)
New to GrepCode? Check out our FAQ X