public class IntroduceConstantHandler extends BaseExpressionToFieldHandler
BaseExpressionToFieldHandler.ConvertToFieldRunnable, BaseExpressionToFieldHandler.InitializationPlace, BaseExpressionToFieldHandler.Settings, BaseExpressionToFieldHandler.TargetDestination
Modifier and Type | Field and Description |
---|---|
protected InplaceIntroduceConstantPopup |
myInplaceIntroduceConstantPopup |
Constructor and Description |
---|
IntroduceConstantHandler() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(ElementToWorkOn elementToWorkOn) |
protected OccurrenceManager |
createOccurrenceManager(PsiExpression selectedExpr,
PsiClass parentClass) |
protected java.lang.String |
getHelpID() |
AbstractInplaceIntroducer |
getInplaceIntroducer() |
PsiClass |
getParentClass(PsiExpression initializerExpression) |
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.
|
void |
invoke(Project project,
PsiExpression[] expressions) |
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, getPhysicalElement, invokeImpl, isStaticFinalInitializer, setModifiers
acceptLocalVariable, invoke, invoke, isAvailableForQuickList
protected InplaceIntroduceConstantPopup myInplaceIntroduceConstantPopup
protected java.lang.String getHelpID()
getHelpID
in class BaseExpressionToFieldHandler
public void invoke(Project project, PsiExpression[] expressions)
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 boolean invokeImpl(Project project, PsiLocalVariable localVariable, Editor editor)
invokeImpl
in class IntroduceHandlerBase
editor
- editor to highlight stuff in. Should accept 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 java.lang.String getRefactoringName()
getRefactoringName
in class BaseExpressionToFieldHandler
public AbstractInplaceIntroducer getInplaceIntroducer()
getInplaceIntroducer
in class IntroduceHandlerBase
protected OccurrenceManager createOccurrenceManager(PsiExpression selectedExpr, PsiClass parentClass)
createOccurrenceManager
in class BaseExpressionToFieldHandler
public PsiClass getParentClass(PsiExpression initializerExpression)
getParentClass
in class BaseExpressionToFieldHandler
protected boolean accept(ElementToWorkOn elementToWorkOn)
accept
in class BaseExpressionToFieldHandler
protected boolean validClass(PsiClass parentClass, Editor editor)
validClass
in class BaseExpressionToFieldHandler
public static java.lang.String getRefactoringNameText()