2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package com
.intellij
.refactoring
;
18 import com
.intellij
.openapi
.components
.ServiceManager
;
20 public abstract class JavaRefactoringActionHandlerFactory
{
21 public static JavaRefactoringActionHandlerFactory
getInstance() {
22 return ServiceManager
.getService(JavaRefactoringActionHandlerFactory
.class);
26 * Creates handler for Anonymous To Inner refactoring.<p>
28 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
32 public abstract RefactoringActionHandler
createAnonymousToInnerHandler();
35 * Creates handler for Pull Members Up refactoring.<p>
37 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
38 * accepts either a {@link com.intellij.psi.PsiClass}, {@link com.intellij.psi.PsiField} or {@link com.intellij.psi.PsiMethod}.
39 * In latter two cases, <code>elements[0]</code> is a member that will be preselected.
41 public abstract RefactoringActionHandler
createPullUpHandler();
44 * Creates handler for Push Members Down refactoring.<p>
46 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
47 * accepts either a {@link com.intellij.psi.PsiClass}, {@link com.intellij.psi.PsiField} or {@link com.intellij.psi.PsiMethod}.
48 * In latter two cases, <code>elements[0]</code> is a member that will be preselected.
50 public abstract RefactoringActionHandler
createPushDownHandler();
53 * Creates handler for Use Interface Where Possible refactoring.<p>
55 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
56 * accepts 1 <code>PsiClass</code>.
59 public abstract RefactoringActionHandler
createTurnRefsToSuperHandler();
62 * Creates handler for Replace Temp With Query refactoring.<p>
64 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
67 public abstract RefactoringActionHandler
createTempWithQueryHandler();
70 * Creates handler for Introduce Parameter refactoring.<p>
72 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
73 * accepts either 1 <code>PsiExpression</code>, that will be an initialzier for introduced parameter,
74 * or 1 <code>PsiLocalVariable</code>, that will be replaced with introduced parameter.
76 public abstract RefactoringActionHandler
createIntroduceParameterHandler();
79 * Creates handler for Make Method Static refactoring.<p>
81 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
82 * accepts 1 <code>PsiMethod</code>.
84 public abstract RefactoringActionHandler
createMakeMethodStaticHandler();
87 * Creates handler for Convert To Instance Method refactoring.<p>
89 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
90 * accepts 1 <code>PsiMethod</code>.
92 public abstract RefactoringActionHandler
createConvertToInstanceMethodHandler();
95 * Creates handler for Replace Constructor With Factory Method refactoring.<p>
97 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
98 * accepts either a <code>PsiMethod</code> that is a constructor, or a <code>PsiClass</code>
99 * with implicit default constructor.
101 public abstract RefactoringActionHandler
createReplaceConstructorWithFactoryHandler();
105 * Creates handler for Replace Constructor With Factory Method refactoring.<p>
107 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
108 * accepts either a <code>PsiClass</code> or any number of <code>PsiField</code>s.
110 public abstract RefactoringActionHandler
createEncapsulateFieldsHandler();
113 * Creates handler for Replace Method Code Duplicates refactoring.<p>
115 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
116 * accepts one <code>PsiMethod</code>.
118 public abstract RefactoringActionHandler
createMethodDuplicatesHandler();
121 * Creates handler for Change Method/Class Signature refactoring.<p>
123 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
124 * accepts either 1 <code>PsiMethod</code> or 1 <code>PsiClass</code>
126 public abstract RefactoringActionHandler
createChangeSignatureHandler();
129 * Creates handler for Extract Superclass refactoring.<p>
131 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
132 * accepts 1 <code>PsiClass</code>.
134 public abstract RefactoringActionHandler
createExtractSuperclassHandler();
137 * Creates handler for Generify (aka Type Cook) refactoring.<p>
139 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
140 * accepts any number of arbitrary <code>PsiElement</code>s. All code inside these elements will be generified.
142 public abstract RefactoringActionHandler
createTypeCookHandler();
145 * Creates handler for Inline refactoring.<p>
147 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
148 * accepts 1 inlinable <code>PsiElement</code> (method, local variable or constant).
150 public abstract RefactoringActionHandler
createInlineHandler();
153 * Creates handler for Extract Method refactoring.<p>
155 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
156 * is not implemented.
158 public abstract RefactoringActionHandler
createExtractMethodHandler();
160 public abstract RefactoringActionHandler
createInheritanceToDelegationHandler();
163 * Creates handler for Extract Interface refactoring.<p>
165 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
166 * accepts 1 <code>PsiClass</code>.
168 public abstract RefactoringActionHandler
createExtractInterfaceHandler();
171 * Creates handler for Introduce Field refactoring.<p>
173 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
174 * accepts either 1 <code>PsiExpression</code>, that will be an initialzier for introduced field,
175 * or 1 <code>PsiLocalVariable</code>, that will be replaced with introduced field.
177 public abstract RefactoringActionHandler
createIntroduceFieldHandler();
180 * Creates handler for Introduce Variable refactoring.<p>
182 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
183 * accepts 1 <code>PsiExpression</code>, that will be an initialzier for introduced variable.
185 public abstract RefactoringActionHandler
createIntroduceVariableHandler();
188 * Creates handler for Introduce Constant refactoring.<p>
190 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
191 * accepts either 1 <code>PsiExpression</code>, that will be an initialzier for introduced constant,
192 * or 1 <code>PsiLocalVariable</code>, that will be replaced with introduced constant.
194 public abstract RefactoringActionHandler
createIntroduceConstantHandler();
197 * Creates handler for Invert Boolean refactoring.<p>
199 * {@link RefactoringActionHandler#invoke(com.intellij.openapi.project.Project, com.intellij.psi.PsiElement[], com.intellij.openapi.actionSystem.DataContext)}
200 * accepts 1 <code>PsiMethod</code>, that will be inverted
202 public abstract RefactoringActionHandler
createInvertBooleanHandler();