Extract search action name

This commit is contained in:
Alexey Sedunov
2013-08-02 16:14:49 +04:00
parent eb1d458807
commit 4ee9783101
3 changed files with 13 additions and 7 deletions
@@ -257,9 +257,11 @@ usageType.selector = Selector
x.in.y={0} in {1}
x.implements.y={0} in {1} implements {2} in {3}.
x.overrides.y.in.class.list={0} in {1} overrides functions in the following classes/traits: {2} Do you want to delete (with usage search) the base methods?
x.overrides.y.in.class.list={0} in {1} overrides functions in the following classes/traits: {2} Do you want to {3} the base methods?
unused.overriding.methods.title=Unused Overriding Members
there.are.unused.methods.that.override.methods.you.delete=There are unused members that override methods you delete.
choose.the.ones.you.want.to.be.deleted=Choose the ones you want to be deleted.
method.column=Member
delete.param.in.method.hierarchy={0} is a part of method hierarchy. Do you want to delete multiple parameters?
delete.param.in.method.hierarchy={0} is a part of method hierarchy. Do you want to delete multiple parameters?
super.methods.delete.with.usage.search=delete (with usage search)
@@ -117,7 +117,7 @@ public class JetRefactoringUtil {
@Nullable
public static Collection<? extends PsiElement> checkSuperMethods(
@NotNull JetDeclaration declaration, @Nullable Collection<PsiElement> ignore
@NotNull JetDeclaration declaration, @Nullable Collection<PsiElement> ignore, @NotNull String actionStringKey
) {
final BindingContext bindingContext =
AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) declaration.getContainingFile()).getBindingContext();
@@ -144,7 +144,7 @@ public class JetRefactoringUtil {
if (superMethods.isEmpty()) return Collections.singletonList(declaration);
java.util.List<String> superClasses = getClassDescriptions(bindingContext, superMethods);
return askUserForMethodsToSearch(declaration, callableDescriptor, superMethods, superClasses);
return askUserForMethodsToSearch(declaration, callableDescriptor, superMethods, superClasses, actionStringKey);
}
@NotNull
@@ -152,14 +152,16 @@ public class JetRefactoringUtil {
@NotNull JetDeclaration declaration,
@NotNull CallableMemberDescriptor callableDescriptor,
@NotNull Collection<? extends PsiElement> superMethods,
@NotNull List<String> superClasses
@NotNull List<String> superClasses,
@NotNull String actionStringKey
) {
String superClassesStr = "\n" + StringUtil.join(superClasses, "");
String message = JetBundle.message(
"x.overrides.y.in.class.list",
DescriptorRenderer.COMPACT.render(callableDescriptor),
DescriptorRenderer.SOURCE_CODE_SHORT_NAMES_IN_TYPES.render(callableDescriptor.getContainingDeclaration()),
superClassesStr
superClassesStr,
JetBundle.message(actionStringKey)
);
int exitCode = Messages.showYesNoCancelDialog(
@@ -790,7 +790,9 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
}
if (element instanceof JetNamedFunction || element instanceof JetProperty) {
return JetRefactoringUtil.checkSuperMethods((JetDeclaration) element, allElementsToDelete);
return JetRefactoringUtil.checkSuperMethods(
(JetDeclaration) element, allElementsToDelete, "super.methods.delete.with.usage.search"
);
}
return super.getElementsToSearch(element, module, allElementsToDelete);