]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/jdt-before/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/InferTypeArgumentsRefactoringContribution.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / core refactoring / org / eclipse / jdt / internal / corext / refactoring / scripting / InferTypeArgumentsRefactoringContribution.java
CommitLineData
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 *******************************************************************************/
11package org.eclipse.jdt.internal.corext.refactoring.scripting;
12
13import java.util.Map;
14
15import org.eclipse.core.runtime.CoreException;
16
17import org.eclipse.ltk.core.refactoring.Refactoring;
18import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
19import org.eclipse.ltk.core.refactoring.RefactoringStatus;
20
21import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor;
22
23import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory;
24import org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments;
25import org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring;
26
27/**
28 * Refactoring contribution for the infer typearguments refactoring.
29 *
30 * @since 3.2
31 */
32public final class InferTypeArgumentsRefactoringContribution extends JavaUIRefactoringContribution {
33
34 /**
35 * {@inheritDoc}
36 */
37 @Override
38 public final Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) throws CoreException {
39 JavaRefactoringArguments arguments= new JavaRefactoringArguments(descriptor.getProject(), retrieveArgumentMap(descriptor));
40 return new InferTypeArgumentsRefactoring(arguments, status);
41 }
42
43 @Override
44 public RefactoringDescriptor createDescriptor() {
45 return RefactoringSignatureDescriptorFactory.createInferTypeArgumentsDescriptor();
46 }
47
48 @Override
49 public RefactoringDescriptor createDescriptor(String id, String project, String description, String comment, Map arguments, int flags) {
50 return RefactoringSignatureDescriptorFactory.createInferTypeArgumentsDescriptor(project, description, comment, arguments, flags);
51 }
52}