]>
Commit | Line | Data |
---|---|---|
1b2798f6 EK |
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 | |
7 | * | |
8 | * Contributors: | |
9 | * IBM Corporation - initial API and implementation | |
10 | *******************************************************************************/ | |
11 | package org.eclipse.jdt.internal.corext.refactoring.scripting; | |
12 | ||
13 | import java.util.Map; | |
14 | ||
15 | import org.eclipse.core.runtime.CoreException; | |
16 | ||
17 | import org.eclipse.ltk.core.refactoring.Refactoring; | |
18 | import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; | |
19 | import org.eclipse.ltk.core.refactoring.RefactoringStatus; | |
20 | import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring; | |
21 | ||
22 | import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor; | |
23 | ||
24 | import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory; | |
25 | import org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments; | |
26 | import org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureProcessor; | |
27 | ||
28 | /** | |
29 | * Refactoring contribution for the change method signature refactoring. | |
30 | * | |
31 | * @since 3.2 | |
32 | */ | |
33 | public final class ChangeMethodSignatureRefactoringContribution extends JavaUIRefactoringContribution { | |
34 | ||
35 | /** | |
36 | * {@inheritDoc} | |
37 | */ | |
38 | @Override | |
39 | public Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) throws CoreException { | |
40 | JavaRefactoringArguments arguments= new JavaRefactoringArguments(descriptor.getProject(), retrieveArgumentMap(descriptor)); | |
41 | ChangeSignatureProcessor processor= new ChangeSignatureProcessor(arguments, status); | |
42 | return new ProcessorBasedRefactoring(processor); | |
43 | } | |
44 | ||
45 | @Override | |
46 | public RefactoringDescriptor createDescriptor() { | |
47 | return RefactoringSignatureDescriptorFactory.createChangeMethodSignatureDescriptor(); | |
48 | } | |
49 | ||
50 | @Override | |
51 | public RefactoringDescriptor createDescriptor(String id, String project, String description, String comment, Map arguments, int flags) { | |
52 | return RefactoringSignatureDescriptorFactory.createChangeMethodSignatureDescriptor(project, description, comment, arguments, flags); | |
53 | } | |
54 | ||
55 | } |