OSDN Git Service

android-2.1_r1 snapshot
[android-x86/sdk.git] / eclipse / plugins / com.android.ide.eclipse.adt / src / com / android / ide / eclipse / adt / internal / refactorings / extractstring / ExtractStringContribution.java
1 /*
2  * Copyright (C) 2009 The Android Open Source Project
3  *
4  * Licensed under the Eclipse Public License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * 
8  *      http://www.eclipse.org/org/documents/epl-v10.php
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package com.android.ide.eclipse.adt.internal.refactorings.extractstring;
18
19 import org.eclipse.ltk.core.refactoring.RefactoringContribution;
20 import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
21
22 import java.util.Map;
23
24 /**
25  * @see ExtractStringDescriptor
26  */
27 public class ExtractStringContribution extends RefactoringContribution {
28     
29     /* (non-Javadoc)
30      * @see org.eclipse.ltk.core.refactoring.RefactoringContribution#createDescriptor(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, int)
31      */
32     @SuppressWarnings("unchecked")
33     @Override
34     public RefactoringDescriptor createDescriptor(
35             String id,
36             String project,
37             String description,
38             String comment,
39             Map arguments,
40             int flags)
41                 throws IllegalArgumentException {
42         return new ExtractStringDescriptor(project, description, comment, arguments);
43     }
44
45     @SuppressWarnings("unchecked")
46     @Override
47     public Map retrieveArgumentMap(RefactoringDescriptor descriptor) {
48         if (descriptor instanceof ExtractStringDescriptor) {
49             return ((ExtractStringDescriptor) descriptor).getArguments();
50         }
51         return super.retrieveArgumentMap(descriptor);
52     }
53 }