public class IntroduceFieldHandler extends BaseExpressionToFieldHandler
BaseExpressionToFieldHandler.ConvertToFieldRunnable, BaseExpressionToFieldHandler.InitializationPlace, BaseExpressionToFieldHandler.Settings, BaseExpressionToFieldHandler.TargetDestination
Constructor and Description |
---|
IntroduceFieldHandler() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(ElementToWorkOn elementToWorkOn) |
protected OccurrenceManager |
createOccurrenceManager(PsiExpression selectedExpr,
PsiClass parentClass) |
protected int |
getChosenClassIndex(java.util.List<PsiClass> classes) |
protected java.lang.String |
getHelpID() |
AbstractInplaceIntroducer |
getInplaceIntroducer() |
protected java.lang.String |
getRefactoringName() |
static java.lang.String |
getRefactoringNameText() |
void |
invoke(Project project,
Editor editor,
PsiFile file,
DataContext dataContext)
Invokes refactoring action from editor.
|
protected boolean |
invokeImpl(Project project,
PsiLocalVariable localVariable,
Editor editor) |
protected BaseExpressionToFieldHandler.Settings |
showRefactoringDialog(Project project,
Editor editor,
PsiClass parentClass,
PsiExpression expr,
PsiType type,
PsiExpression[] occurrences,
PsiElement anchorElement,
PsiElement anchorElementIfAll) |
protected boolean |
validClass(PsiClass parentClass,
Editor editor) |
getElementProcessor, getEnclosingConstructor, getParentClass, getParentClass, getPhysicalElement, invokeImpl, isStaticFinalInitializer, setModifiers
acceptLocalVariable, invoke, invoke, isAvailableForQuickList
protected java.lang.String getRefactoringName()
getRefactoringName
in class BaseExpressionToFieldHandler
protected boolean validClass(PsiClass parentClass, Editor editor)
validClass
in class BaseExpressionToFieldHandler
protected java.lang.String getHelpID()
getHelpID
in class BaseExpressionToFieldHandler
public void invoke(Project project, Editor editor, PsiFile file, DataContext dataContext)
RefactoringActionHandler
project
- the project in which the refactoring is invoked.editor
- editor that refactoring is invoked infile
- file should correspond to editor
dataContext
- can be null
for some but not all of refactoring action handlers
(it is recommended to pass DataManager.getDataContext()
instead of null
)protected BaseExpressionToFieldHandler.Settings showRefactoringDialog(Project project, Editor editor, PsiClass parentClass, PsiExpression expr, PsiType type, PsiExpression[] occurrences, PsiElement anchorElement, PsiElement anchorElementIfAll)
showRefactoringDialog
in class BaseExpressionToFieldHandler
protected boolean accept(ElementToWorkOn elementToWorkOn)
accept
in class BaseExpressionToFieldHandler
public AbstractInplaceIntroducer getInplaceIntroducer()
getInplaceIntroducer
in class IntroduceHandlerBase
protected OccurrenceManager createOccurrenceManager(PsiExpression selectedExpr, PsiClass parentClass)
createOccurrenceManager
in class BaseExpressionToFieldHandler
protected boolean invokeImpl(Project project, PsiLocalVariable localVariable, Editor editor)
invokeImpl
in class IntroduceHandlerBase
editor
- editor to highlight stuff in. Should accept null
protected int getChosenClassIndex(java.util.List<PsiClass> classes)
public static java.lang.String getRefactoringNameText()