i18n && wording (IDEA-72585 )

This commit is contained in:
anna
2011-08-21 17:39:34 +02:00
parent 12e8bcbd5d
commit c71a873d1d
29 changed files with 33 additions and 30 deletions
@@ -109,15 +109,15 @@ public class ChangeMethodSignatureFromUsageFix implements IntentionAction, HighP
if (myTargetMethod.getContainingClass().findMethodsByName(targetMethodName, true).length == 1) {
if (newParams.size() == 1) {
final ParameterInfoImpl p = newParams.iterator().next();
return "Add " + p.getTypeText() + " as " + (ArrayUtil.find(myNewParametersInfo, p) + 1) + " parameter to method " + targetMethodName;
return QuickFixBundle.message("add.parameter.from.usage.text", p.getTypeText(), (ArrayUtil.find(myNewParametersInfo, p) + 1), targetMethodName);
}
if (removedParams.size() == 1) {
final ParameterInfoImpl p = removedParams.iterator().next();
return "Remove " + (p.getOldIndex() + 1) + " parameter from method " + targetMethodName;
return QuickFixBundle.message("remove.parameter.from.usage.text", (p.getOldIndex() + 1), targetMethodName);
}
if (changedParams.size() == 1) {
final ParameterInfoImpl p = changedParams.iterator().next();
return "Change " + (p.getOldIndex() + 1)+ " parameter of method " +targetMethodName + " from " + myTargetMethod.getParameterList().getParameters()[p.getOldIndex()].getType().getPresentableText() + " to " + p.getTypeText();
return QuickFixBundle.message("change.parameter.from.usage.text", (p.getOldIndex() + 1), targetMethodName, myTargetMethod.getParameterList().getParameters()[p.getOldIndex()].getType().getPresentableText(), p.getTypeText());
}
}
return "<html> Change signature of " + targetMethodName + "(" + buf.toString() + ")</html>";
@@ -1,4 +1,4 @@
// "Remove 1 parameter from method f" "true"
// "Remove 1st parameter from method 'f'" "true"
class A {
void f() {}
public void foo() {
@@ -1,4 +1,4 @@
// "Add String as 2 parameter to method set" "true"
// "Add 'String' as 2nd parameter to method 'set'" "true"
import java.util.List;
public class X<T> {
@@ -1,4 +1,4 @@
// "Add char as 2 parameter to method f" "true"
// "Add 'char' as 2nd parameter to method 'f'" "true"
class A {
void f(int i, char c, String s) {}
public void foo() {
@@ -1,4 +1,4 @@
// "Remove 2 parameter from method f" "true"
// "Remove 2nd parameter from method 'f'" "true"
class A {
void f(int i, int i2) {}
public void foo() {
@@ -1,4 +1,4 @@
// "Change 2 parameter of method f from String to int" "true"
// "Change 2nd parameter of method 'f' from 'String' to 'int'" "true"
class A {
void f(int i, int s, int i2) {}
public void foo() {
@@ -1,4 +1,4 @@
// "Add int as 2 parameter to method f" "true"
// "Add 'int' as 2nd parameter to method 'f'" "true"
public class S {
void f(int k, int i, int... args) {
f(1,1,null)<caret>;// -> f(1,1,null)
@@ -1,4 +1,4 @@
// "Add Foo<TypeParamName> as 1 parameter to method Bar" "true"
// "Add 'Foo<TypeParamName>' as 1st parameter to method 'Bar'" "true"
public class Bar {
Bar(Foo<TypeParamName> typeParamNameFoo, String args) {
@@ -1,4 +1,4 @@
// "Add Foo<TypeParamName> as 1 parameter to method bar" "true"
// "Add 'Foo<TypeParamName>' as 1st parameter to method 'bar'" "true"
public class Bar {
static void bar(Foo<TypeParamName> typeParamNameFoo, String args) {
@@ -1,4 +1,4 @@
// "Add int as 1 parameter to method f" "true"
// "Add 'int' as 1st parameter to method 'f'" "true"
public class S {
void f(int i, String args) {
@@ -1,4 +1,4 @@
// "Add Inner1 as 1 parameter to method Inner2" "true"
// "Add 'Inner1' as 1st parameter to method 'Inner2'" "true"
class CoolTest {
class Inner1 {}
@@ -1,4 +1,4 @@
// "Add String as 1 parameter to method f" "true"
// "Add 'String' as 1st parameter to method 'f'" "true"
public class S {
void f(String s, int... args) {
f("",1,1);
@@ -1,4 +1,4 @@
// "Add String as 1 parameter to method f" "true"
// "Add 'String' as 1st parameter to method 'f'" "true"
public class S {
void f(String s, int... args) {
f("",null);
@@ -1,4 +1,4 @@
// "Remove 1 parameter from method f" "true"
// "Remove 1st parameter from method 'f'" "true"
class A {
void f(int i) {}
public void foo() {
@@ -1,4 +1,4 @@
// "Add String as 2 parameter to method set" "true"
// "Add 'String' as 2nd parameter to method 'set'" "true"
import java.util.List;
public class X<T> {
@@ -1,4 +1,4 @@
// "Add char as 2 parameter to method f" "true"
// "Add 'char' as 2nd parameter to method 'f'" "true"
class A {
void f(int i,String s) {}
public void foo() {
@@ -1,4 +1,4 @@
// "Remove 2 parameter from method f" "true"
// "Remove 2nd parameter from method 'f'" "true"
class A {
void f(int i, String s, int i2) {}
public void foo() {
@@ -1,4 +1,4 @@
// "Change 2 parameter of method f from String to int" "true"
// "Change 2nd parameter of method 'f' from 'String' to 'int'" "true"
class A {
void f(int i, String s, int i2) {}
public void foo() {
@@ -1,4 +1,4 @@
// "Add int as 2 parameter to method f" "true"
// "Add 'int' as 2nd parameter to method 'f'" "true"
public class S {
void f(int k, int... args) {
f(1,1,null)<caret>;// -> f(1,1,null)
@@ -1,4 +1,4 @@
// "Add Foo<TypeParamName> as 1 parameter to method Bar" "true"
// "Add 'Foo<TypeParamName>' as 1st parameter to method 'Bar'" "true"
public class Bar {
Bar(String args) {
@@ -1,4 +1,4 @@
// "Add Foo<TypeParamName> as 1 parameter to method bar" "true"
// "Add 'Foo<TypeParamName>' as 1st parameter to method 'bar'" "true"
public class Bar {
static void bar(String args) {
@@ -1,4 +1,4 @@
// "Add int as 1 parameter to method f" "false"
// "Add 'int' as 1st parameter to method 'f'" "false"
public class Foo {
void foo(Bar f) {
f.f<caret>(2);
@@ -1,4 +1,4 @@
// "Add int as 1 parameter to method f" "true"
// "Add 'int' as 1st parameter to method 'f'" "true"
public class S {
void f(String args) {
@@ -1,4 +1,4 @@
// "Change 1 parameter of method parseInt from String to int" "false"
// "Change 1st parameter of method 'parseInt' from 'String' to 'int'" "false"
class A {
public void foo() {
<caret>Integer.parseInt(1);
@@ -1,4 +1,4 @@
// "Add Inner1 as 1 parameter to method Inner2" "true"
// "Add 'Inner1' as 1st parameter to method 'Inner2'" "true"
class CoolTest {
class Inner1 {}
@@ -1,4 +1,4 @@
// "Add String as 1 parameter to method f" "true"
// "Add 'String' as 1st parameter to method 'f'" "true"
public class S {
void f(int... args) {
f("",1,1)<caret>;
@@ -1,4 +1,4 @@
// "Add String as 1 parameter to method f" "true"
// "Add 'String' as 1st parameter to method 'f'" "true"
public class S {
void f(int... args) {
f("",null)<caret>;
@@ -1,4 +1,4 @@
// "Add String as 2nd parameter to method f" "false"
// "Add 'String' as 2nd parameter to method 'f'" "false"
public class S {
void f(int... args) {
f(1,1, "")<caret>;
@@ -45,6 +45,9 @@ change.method.signature.from.usage.family=Change method signature from usage
# {0} - original method signature including name, {1} - method name, {2} - proposed new parameters list
change.method.signature.from.usage.text=Change signature of ''{0}'' to ''{1}({2})''
add.parameter.from.usage.text=Add ''{0}'' as {1, choice, 1#1st|2#2nd|3#3rd|4#{0,number}th} parameter to method ''{2}''
remove.parameter.from.usage.text=Remove {0, choice, 1#1st|2#2nd|3#3rd|4#{0,number}th} parameter from method ''{1}''
change.parameter.from.usage.text=Change {0, choice, 1#1st|2#2nd|3#3rd|4#{0,number}th} parameter of method ''{1}'' from ''{2}'' to ''{3}''
searching.for.usages.progress.title=Searching For Usages...
create.class.from.new.family=Create Class from New
create.class.from.new.text=Create Class ''{0}''