X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=case-study%2Fjdt-after%2Fcore%20refactoring%2Forg%2Feclipse%2Fjdt%2Finternal%2Fcorext%2Frefactoring%2Fscripting%2FRenamePackageRefactoringContribution.java;fp=case-study%2Fjdt-after%2Fcore%20refactoring%2Forg%2Feclipse%2Fjdt%2Finternal%2Fcorext%2Frefactoring%2Fscripting%2FRenamePackageRefactoringContribution.java;h=3e8b83d615b2419f18308873f6c0722793696894;hb=1b2798f607d741df30e5197f427381cbff326adc;hp=0000000000000000000000000000000000000000;hpb=246231e4bd9b24345490f369747c0549ca308c4d;p=ifi-stolz-refaktor.git diff --git a/case-study/jdt-after/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/RenamePackageRefactoringContribution.java b/case-study/jdt-after/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/RenamePackageRefactoringContribution.java new file mode 100644 index 00000000..3e8b83d6 --- /dev/null +++ b/case-study/jdt-after/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/RenamePackageRefactoringContribution.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2005, 2011 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.corext.refactoring.scripting; + +import java.util.Map; + +import org.eclipse.ltk.core.refactoring.Refactoring; +import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; +import org.eclipse.ltk.core.refactoring.RefactoringStatus; +import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring; + +import org.eclipse.jdt.core.refactoring.IJavaRefactorings; +import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor; + +import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory; +import org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments; +import org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor; + +/** + * Refactoring contribution for the rename package refactoring. + * + * @since 3.2 + */ +public final class RenamePackageRefactoringContribution extends JavaUIRefactoringContribution { + + /** + * {@inheritDoc} + */ + @Override + public Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) { + JavaRefactoringArguments arguments= new JavaRefactoringArguments(descriptor.getProject(), retrieveArgumentMap(descriptor)); + RenamePackageProcessor processor= new RenamePackageProcessor(arguments, status); + return new RenameRefactoring(processor); + } + + @Override + public RefactoringDescriptor createDescriptor() { + return RefactoringSignatureDescriptorFactory.createRenameJavaElementDescriptor(IJavaRefactorings.RENAME_PACKAGE); + } + + @Override + public RefactoringDescriptor createDescriptor(String id, String project, String description, String comment, Map arguments, int flags) { + return RefactoringSignatureDescriptorFactory.createRenameJavaElementDescriptor(id, project, description, comment, arguments, flags); + } +}