mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
Java: update Inline dialog texts (IJPL-10853)
GitOrigin-RevId: bf16bed93bb6fa83ec6c9e626bc2d30b76e05e5b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1375efd017
commit
d2f7d55a95
@@ -10,7 +10,6 @@ import com.intellij.psi.util.PsiFormatUtilBase;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.refactoring.HelpID;
|
||||
import com.intellij.refactoring.JavaRefactoringSettings;
|
||||
import com.intellij.refactoring.RefactoringBundle;
|
||||
|
||||
public class InlineFieldDialog extends InlineOptionsWithSearchSettingsDialog {
|
||||
private final PsiElement myReferenceExpression;
|
||||
@@ -22,25 +21,22 @@ public class InlineFieldDialog extends InlineOptionsWithSearchSettingsDialog {
|
||||
super(project, true, field);
|
||||
myField = field;
|
||||
myReferenceExpression = ref;
|
||||
myInvokedOnReference = myReferenceExpression != null;
|
||||
myOccurrencesNumber = getNumberOfOccurrences(myField);
|
||||
myInvokedOnReference = myReferenceExpression != null && myOccurrencesNumber != 1;
|
||||
|
||||
setTitle(getRefactoringName());
|
||||
myOccurrencesNumber = getNumberOfOccurrences(myField);
|
||||
init();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getNameLabelText() {
|
||||
String fieldText = PsiFormatUtil.formatVariable(myField, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_TYPE, PsiSubstitutor.EMPTY);
|
||||
String occurrencesString = myOccurrencesNumber > -1 ?
|
||||
JavaRefactoringBundle.message("inline.field.field.occurrences", fieldText, myOccurrencesNumber) :
|
||||
JavaRefactoringBundle.message("inline.field.field.name.label", fieldText);
|
||||
return JavaRefactoringBundle.message("inline.field.field.name.label", fieldText, occurrencesString);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBorderTitle() {
|
||||
return RefactoringBundle.message("inline.field.border.title");
|
||||
int options = myReferenceExpression != null
|
||||
? PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME
|
||||
: PsiFormatUtilBase.SHOW_NAME;
|
||||
String fieldText = PsiFormatUtil.formatVariable(myField, options, PsiSubstitutor.EMPTY);
|
||||
return myOccurrencesNumber > -1 ?
|
||||
JavaRefactoringBundle.message("inline.field.field.occurrences", fieldText, myOccurrencesNumber) :
|
||||
JavaRefactoringBundle.message("inline.field.field.name.label", fieldText);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,9 +46,7 @@ public class InlineFieldDialog extends InlineOptionsWithSearchSettingsDialog {
|
||||
|
||||
@Override
|
||||
protected String getInlineAllText() {
|
||||
return isLibraryInline()
|
||||
? RefactoringBundle.message("all.invocations.in.project")
|
||||
: JavaRefactoringBundle.message("all.references.and.remove.the.field");
|
||||
return JavaRefactoringBundle.message(isLibraryInline() ? "all.invocations.in.project" : "all.references.and.remove.the.field");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,8 +27,8 @@ public class InlineMethodDialog extends InlineOptionsWithSearchSettingsDialog {
|
||||
myReference = ref;
|
||||
myEditor = editor;
|
||||
myAllowInlineThisOnly = allowInlineThisOnly;
|
||||
myInvokedOnReference = ref != null;
|
||||
myOccurrencesNumber = getNumberOfOccurrences(method);
|
||||
myInvokedOnReference = ref != null && myOccurrencesNumber != 1;
|
||||
|
||||
setTitle(getRefactoringName());
|
||||
init();
|
||||
@@ -41,27 +41,23 @@ public class InlineMethodDialog extends InlineOptionsWithSearchSettingsDialog {
|
||||
|
||||
@Override
|
||||
protected String getNameLabelText() {
|
||||
String methodText = PsiFormatUtil.formatMethod(myMethod,
|
||||
PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS,
|
||||
PsiFormatUtilBase.SHOW_TYPE);
|
||||
int options = myReference != null
|
||||
? PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS
|
||||
: PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS;
|
||||
String methodText = PsiFormatUtil.formatMethod(myMethod, PsiSubstitutor.EMPTY, options, PsiFormatUtilBase.SHOW_TYPE);
|
||||
return myOccurrencesNumber > -1 ?
|
||||
JavaRefactoringBundle.message("inline.method.method.occurrences", methodText, myOccurrencesNumber) :
|
||||
JavaRefactoringBundle.message("inline.method.method.label", methodText);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBorderTitle() {
|
||||
return RefactoringBundle.message("inline.method.border.title");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getInlineThisText() {
|
||||
return RefactoringBundle.message("this.invocation.only.and.keep.the.method");
|
||||
return JavaRefactoringBundle.message("this.invocation.only.and.keep.the.method");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getInlineAllText() {
|
||||
return RefactoringBundle.message(isLibraryInline() ? "all.invocations.in.project" : "all.invocations.and.remove.the.method");
|
||||
return JavaRefactoringBundle.message(isLibraryInline() ? "all.invocations.in.project" : "all.invocations.and.remove.the.method");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user