diff --git a/plugins/groovy/resources/messages/GroovyRefactoringBundle.properties b/plugins/groovy/resources/messages/GroovyRefactoringBundle.properties index 31c993e67a89..045743dec93a 100644 --- a/plugins/groovy/resources/messages/GroovyRefactoringBundle.properties +++ b/plugins/groovy/resources/messages/GroovyRefactoringBundle.properties @@ -20,12 +20,10 @@ specify.type.label=Specify return &type explicitly signature.preview.border.title=Signature Preview method.is.already.defined.in.class=Method {0} is already defined in the class {1}. method.is.already.defined.in.script=Method {0} is already defined in the script {1}. -inline.method.title=Inline Method -inline.method.border.title=Inline -inline.method.label=Method {0} -all.invocations.and.remove.the.method=Inline &all invocations and remove the method -all.invocations.in.project=Inline &all invocations in project -this.invocation.only.and.keep.the.method=Inline &this invocation only and keep the method +inline.method.label=Inline method ''{0}'' +all.invocations.and.remove.the.method=Inline &all usages and remove the method +all.invocations.in.project=Inline &all usages in the project +this.invocation.only.and.keep.the.method=Inline &this usage only and keep the method refactoring.cannot.be.applied.to.abstract.methods=Refactoring cannot be applied to abstract methods refactoring.cannot.be.applied.no.sources.attached=Refactoring cannot be applied: no sources attached refactoring.is.not.supported.when.return.statement.interrupts.the.execution.flow=Refactoring is not supported when return statement interrupts the execution flow diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/GroovyInlineMethodUtil.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/GroovyInlineMethodUtil.java index 5dc78f45965e..6c1738e0a1d1 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/GroovyInlineMethodUtil.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/GroovyInlineMethodUtil.java @@ -1,5 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.plugins.groovy.refactoring.inline; import com.intellij.codeInsight.TargetElementUtil; @@ -15,6 +14,7 @@ import com.intellij.psi.search.LocalSearchScope; import com.intellij.psi.search.searches.ReferencesSearch; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.refactoring.HelpID; +import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.inline.InlineOptionsDialog; import com.intellij.refactoring.util.CommonRefactoringUtil; import com.intellij.util.IncorrectOperationException; @@ -339,11 +339,6 @@ public final class GroovyInlineMethodUtil { init(); } - @Override - protected String getBorderTitle() { - return GroovyRefactoringBundle.message("inline.method.border.title"); - } - @Override protected String getNameLabelText() { return GroovyRefactoringBundle.message("inline.method.label", GroovyRefactoringUtil.getMethodSignature(myMethod)); @@ -570,6 +565,6 @@ public final class GroovyInlineMethodUtil { } public static @Nls(capitalization = Title) String getRefactoringName() { - return GroovyRefactoringBundle.message("inline.method.title"); + return RefactoringBundle.message("inline.method.title"); } } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/InlineGroovyFieldDialog.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/InlineGroovyFieldDialog.java index 50ad2d3a63dc..077bb01e73f1 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/InlineGroovyFieldDialog.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/InlineGroovyFieldDialog.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.plugins.groovy.refactoring.inline; import com.intellij.java.refactoring.JavaRefactoringBundle; @@ -6,9 +6,9 @@ import com.intellij.openapi.project.Project; import com.intellij.psi.PsiField; import com.intellij.psi.PsiSubstitutor; import com.intellij.psi.util.PsiFormatUtil; +import com.intellij.psi.util.PsiFormatUtilBase; import com.intellij.refactoring.HelpID; import com.intellij.refactoring.JavaRefactoringSettings; -import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.inline.InlineOptionsDialog; import org.jetbrains.annotations.Nls; @@ -32,14 +32,11 @@ class InlineGroovyFieldDialog extends InlineOptionsDialog { @Override protected String getNameLabelText() { - @SuppressWarnings("StaticFieldReferencedViaSubclass") - String fieldText = PsiFormatUtil.formatVariable(myField, PsiFormatUtil.SHOW_NAME | PsiFormatUtil.SHOW_TYPE, PsiSubstitutor.EMPTY); - return JavaRefactoringBundle.message("inline.field.field.name.label", fieldText, ""); - } - - @Override - protected String getBorderTitle() { - return RefactoringBundle.message("inline.field.border.title"); + int options = myInvokedOnReference + ? PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME + : PsiFormatUtilBase.SHOW_NAME; + String fieldText = PsiFormatUtil.formatVariable(myField, options, PsiSubstitutor.EMPTY); + return JavaRefactoringBundle.message("inline.field.field.name.label", fieldText); } @Override