extensibility for Pull Up and Push Down
[fedora-idea.git] / lang-api / src / com / intellij / lang / refactoring / RefactoringSupportProvider.java
blob4b1d31c815acfb3f26e2c22c9755bf8023157456
1 /*
2 * Copyright 2000-2007 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.lang.refactoring;
18 import com.intellij.psi.PsiElement;
19 import com.intellij.refactoring.RefactoringActionHandler;
20 import org.jetbrains.annotations.Nullable;
22 /**
23 * Allows a custom language plugin to control the operation of refactorings for
24 * files in the language.
26 * @author ven
29 public interface RefactoringSupportProvider {
30 /**
31 * Checks if the Safe Delete refactoring can be applied to the specified element
32 * in the language. The Safe Delete refactoring also requires the plugin to implement
33 * Find Usages functionality.
35 * @param element the element for which Safe Delete was invoked
36 * @return true if Safe Delete is available, false otherwise.
38 boolean isSafeDeleteAvailable(PsiElement element);
40 /**
41 * @return handler for introducing local variables in this language
42 * @see com.intellij.refactoring.RefactoringActionHandler
44 @Nullable RefactoringActionHandler getIntroduceVariableHandler();
46 /**
47 * @return handler for extracting methods in this language
48 * @see com.intellij.refactoring.RefactoringActionHandler
50 @Nullable RefactoringActionHandler getExtractMethodHandler();
52 /**
53 * @return handler for introducing constants in this language
54 * @see com.intellij.refactoring.RefactoringActionHandler
56 @Nullable RefactoringActionHandler getIntroduceConstantHandler();
58 /**
59 * @return handler for introducing fields in this language
60 * @see com.intellij.refactoring.RefactoringActionHandler
62 @Nullable RefactoringActionHandler getIntroduceFieldHandler();
64 /**
65 * @return handler for introducing parameters in this language
66 * @see com.intellij.refactoring.RefactoringActionHandler
68 @Nullable RefactoringActionHandler getIntroduceParameterHandler();
70 /**
71 * @return handler for pulling up members in this language
72 * @see com.intellij.refactoring.RefactoringActionHandler
74 @Nullable RefactoringActionHandler getPullUpHandler();
76 /**
77 * @return handler for pulling up members in this language
78 * @see com.intellij.refactoring.RefactoringActionHandler
80 @Nullable RefactoringActionHandler getPushDownHandler();
82 boolean doInplaceRenameFor(PsiElement element, PsiElement context);