1 /*******************************************************************************
2 * Copyright (c) 2005, 2011 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.corext.refactoring.scripting;
15 import org.eclipse.ltk.core.refactoring.Refactoring;
16 import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
17 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
18 import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
20 import org.eclipse.jdt.core.refactoring.IJavaRefactorings;
21 import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor;
23 import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory;
24 import org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments;
25 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor;
28 * Refactoring contribution for the rename field refactoring.
32 public final class RenameFieldRefactoringContribution extends JavaUIRefactoringContribution {
38 public Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) {
39 JavaRefactoringArguments arguments= new JavaRefactoringArguments(descriptor.getProject(), retrieveArgumentMap(descriptor));
40 RenameFieldProcessor processor= new RenameFieldProcessor(arguments, status);
41 return new RenameRefactoring(processor);
45 public RefactoringDescriptor createDescriptor() {
46 return RefactoringSignatureDescriptorFactory.createRenameJavaElementDescriptor(IJavaRefactorings.RENAME_FIELD);
50 public RefactoringDescriptor createDescriptor(String id, String project, String description, String comment, Map arguments, int flags) {
51 return RefactoringSignatureDescriptorFactory.createRenameJavaElementDescriptor(id, project, description, comment, arguments, flags);