introduce: force dialogs for non-physical expressions as it is for introduce variable (IDEA-70845)

This commit is contained in:
anna
2011-06-16 20:45:41 +04:00
parent 7e797a0698
commit bb0af64d02
3 changed files with 6 additions and 2 deletions
@@ -145,7 +145,7 @@ public class IntroduceConstantHandler extends BaseExpressionToFieldHandler {
}
final TypeSelectorManagerImpl typeSelectorManager = new TypeSelectorManagerImpl(project, type, containingMethod, expr, occurences);
if (editor != null && editor.getSettings().isVariableInplaceRenameEnabled()) {
if (editor != null && editor.getSettings().isVariableInplaceRenameEnabled() && (expr == null || expr.isPhysical())) {
if (new InplaceIntroduceConstantPopup(project, editor, parentClass, expr, localVariable, occurences, typeSelectorManager,
anchorElement, anchorElementIfAll,
expr != null ? createOccurenceManager(expr, parentClass) : null).startInplaceIntroduceTemplate() ){
@@ -103,7 +103,7 @@ public class IntroduceFieldHandler extends BaseExpressionToFieldHandler {
final boolean allowInitInMethodIfAll = (!currentMethodConstructor || !isInSuperOrThis) && anchorElementIfAll instanceof PsiStatement;
final TypeSelectorManagerImpl typeSelectorManager = new TypeSelectorManagerImpl(project, type, containingMethod, expr, occurences);
if (editor != null && editor.getSettings().isVariableInplaceRenameEnabled()) {
if (editor != null && editor.getSettings().isVariableInplaceRenameEnabled() && (expr == null || expr.isPhysical())) {
myInplaceIntroduceFieldPopup =
new InplaceIntroduceFieldPopup(localVariable, parentClass, declareStatic, currentMethodConstructor, occurences, expr, typeSelectorManager, editor,
allowInitInMethod, allowInitInMethodIfAll, anchorElement, anchorElementIfAll, expr != null ? createOccurenceManager(expr, parentClass) : null,
@@ -404,6 +404,10 @@ public class IntroduceParameterHandler extends IntroduceHandlerBase implements R
NameSuggestionsGenerator nameSuggestionsGenerator = createNameSuggestionGenerator(myExpr, propName, myProject);
boolean isInplaceAvailableOnDataContext = myEditor != null && myEditor.getSettings().isVariableInplaceRenameEnabled();
if (myExpr != null) {
isInplaceAvailableOnDataContext &= myExpr.isPhysical();
}
if (isInplaceAvailableOnDataContext) {
myInplaceIntroduceParameterPopup =
new InplaceIntroduceParameterPopup(myProject, myEditor, classMemberRefs,