public class JavaVariableInplaceIntroducer extends AbstractJavaInplaceIntroducer
myTypeSelectorManager
ACTIVE_INTRODUCE, myExprText, myFinished, myLocalMarker, myLocalVariable, myWholePanel
myExpr, myExprMarker, myOccurrenceMarkers, myOccurrences
INPLACE_RENAMER, INTRODUCE_RESTART, LOG, myAdvertisementText, myBalloon, myBeforeRevert, myCaretRangeMarker, myEditor, myElementToRename, myInitialName, myInsertedName, myMarkAction, myNameSuggestions, myOldName, myProject, myRenameOffset, myScope, myTarget, myTitle, OTHER_VARIABLE_NAME, ourRenamersStack, PRIMARY_VARIABLE_NAME
Constructor and Description |
---|
JavaVariableInplaceIntroducer(Project project,
IntroduceVariableSettings settings,
PsiElement chosenAnchor,
Editor editor,
PsiExpression expr,
boolean cantChangeFinalModifier,
PsiExpression[] occurrences,
TypeSelectorManagerImpl selectorManager,
java.lang.String title) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAdditionalVariables(TemplateBuilderImpl builder) |
protected void |
addReferenceAtCaret(java.util.Collection<PsiReference> refs) |
static void |
adjustLine(PsiVariable psiVariable,
Document document) |
protected void |
beforeTemplateStart() |
protected void |
collectAdditionalElementsToRename(java.util.List<Pair<PsiElement,TextRange>> stringUsages) |
protected PsiVariable |
createFieldToStartTemplateOn(java.lang.String[] names,
PsiType psiType) |
protected boolean |
createFinals() |
protected void |
deleteTemplateField(PsiVariable variable) |
protected boolean |
ensureValid() |
void |
finish(boolean success) |
protected java.lang.String |
getActionName()
Returns ID of the action the shortcut of which is used to show the non-in-place refactoring dialog.
|
protected PsiExpression |
getBeforeExpr() |
protected int |
getCaretOffset() |
protected javax.swing.JComponent |
getComponent() |
protected java.lang.String |
getRefactoringId() |
protected PsiVariable |
getVariable() |
protected VariableKind |
getVariableKind() |
protected PsiVariable |
introduceVariable() |
boolean |
isReplaceAllOccurrences() |
protected void |
performCleanup()
if brokenOff but not canceled
|
protected void |
performIntroduce() |
protected void |
restoreState(PsiVariable psiField) |
void |
setReplaceAllOccurrences(boolean allOccurrences) |
protected boolean |
startsOnTheSameElement(RefactoringActionHandler handler,
PsiElement element) |
protected java.lang.String[] |
suggestNames(PsiType defaultType,
java.lang.String propName) |
appendUnresolvedExprName, chooseName, correctExpression, createExpression, createFieldToStartTemplateOn, getType, restoreExpression, restoreExpression, saveSettings, suggestNames
addHighlights, adjustHighlightsStartOffset, getActiveIntroducer, getExpressionText, getInputName, getLocalVariable, getPreviewComponent, getPreviewEditor, moveOffsetAfter, performPostIntroduceTasks, performRefactoring, releaseResources, restartInplaceIntroduceTemplate, restoreSelection, revalidate, setPreviewText, shouldSelectAll, showBalloon, startInplaceIntroduceTemplate, startRename, startsOnTheSameElement, updateTitle, updateTitle
createLookupExpression, createMarker, getCommandName, getExpr, getExprMarker, getOccurrenceMarkers, getOccurrences, initOccurrencesMarkers, setExprMarker, setOccurrenceMarkers
acceptReference, adjustBalloon, buildTemplateAndStart, canStartAnotherRefactoring, checkCleared, checkLocalScope, collectRefs, createPreviewComponent, createTemplateExpression, getActiveInplaceRenamer, getInitialName, getNameIdentifier, getRangeToRename, getRangeToRename, getReferencesSearchScope, getSelectedInEditorElement, getTopLevelVirtualFile, isIdentifier, isReferenceAtCaret, isRestart, isShowBalloonInHeadlessMode, navigateToAlreadyStarted, notSameFile, performInplaceRefactoring, releaseIfNotRestart, restoreCaretOffset, revertState, setAdvertisementText, setElementToRename, setShowBalloonInHeadlessMode, shouldStopAtLookupExpression, showBalloonInEditor, showDialogAdvertisement, startsOnTheSameElements, stopIntroduce, stopIntroduce, unableToStartWarning
public JavaVariableInplaceIntroducer(Project project, IntroduceVariableSettings settings, PsiElement chosenAnchor, Editor editor, PsiExpression expr, boolean cantChangeFinalModifier, PsiExpression[] occurrences, TypeSelectorManagerImpl selectorManager, java.lang.String title)
protected void beforeTemplateStart()
beforeTemplateStart
in class InplaceRefactoring
protected PsiVariable getVariable()
getVariable
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected java.lang.String getActionName()
AbstractInplaceIntroducer
getActionName
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected java.lang.String getRefactoringId()
getRefactoringId
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected void restoreState(PsiVariable psiField)
restoreState
in class AbstractJavaInplaceIntroducer
protected boolean ensureValid()
ensureValid
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected void performCleanup()
InplaceRefactoring
performCleanup
in class InplaceRefactoring
protected void deleteTemplateField(PsiVariable variable)
deleteTemplateField
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected PsiExpression getBeforeExpr()
getBeforeExpr
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected void performIntroduce()
performIntroduce
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
public boolean isReplaceAllOccurrences()
isReplaceAllOccurrences
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
public void setReplaceAllOccurrences(boolean allOccurrences)
setReplaceAllOccurrences
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected boolean startsOnTheSameElement(RefactoringActionHandler handler, PsiElement element)
startsOnTheSameElement
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected javax.swing.JComponent getComponent()
getComponent
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected void addAdditionalVariables(TemplateBuilderImpl builder)
addAdditionalVariables
in class InplaceRefactoring
protected void collectAdditionalElementsToRename(java.util.List<Pair<PsiElement,TextRange>> stringUsages)
collectAdditionalElementsToRename
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected void addReferenceAtCaret(java.util.Collection<PsiReference> refs)
addReferenceAtCaret
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected boolean createFinals()
public static void adjustLine(PsiVariable psiVariable, Document document)
protected PsiVariable createFieldToStartTemplateOn(java.lang.String[] names, PsiType psiType)
createFieldToStartTemplateOn
in class AbstractJavaInplaceIntroducer
protected PsiVariable introduceVariable()
protected int getCaretOffset()
getCaretOffset
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
public void finish(boolean success)
finish
in class AbstractInplaceIntroducer<PsiVariable,PsiExpression>
protected java.lang.String[] suggestNames(PsiType defaultType, java.lang.String propName)
suggestNames
in class AbstractJavaInplaceIntroducer
protected VariableKind getVariableKind()
getVariableKind
in class AbstractJavaInplaceIntroducer