IDEA-124247 Please add "Skip to next file" in Find/Replace

IDEA-119130 Feature request: Replace in files dialog "all in file"
This commit is contained in:
Maxim.Mossienko
2014-09-12 16:34:52 +02:00
parent 31a3c1e234
commit 3224ac8c40
4 changed files with 15 additions and 1 deletions
@@ -285,5 +285,6 @@ public abstract class FindManager {
int ALL = 3;
int ALL_IN_THIS_FILE = 4;
int ALL_FILES = 5;
int SKIP_ALL_IN_THIS_FILE = 6;
}
}
@@ -310,6 +310,17 @@ public class ReplaceInProjectManager {
}
}
if (result == FindManager.PromptResult.SKIP_ALL_IN_THIS_FILE) {
int j;
for(j = i + 1;j < usages.length; ++j) {
final PsiElement nextElt = ((UsageInfo2UsageAdapter)usages[j]).getUsageInfo().getElement();
if (nextElt == null) continue;
if (nextElt.getContainingFile() == psiFile) continue;
break;
}
i = j -1;
}
if (result == FindManager.PromptResult.ALL_IN_THIS_FILE) {
final int[] nextNumber = new int[1];
@@ -56,6 +56,7 @@ public class ReplacePromptDialog extends DialogWrapper {
replaceAction,
createSkipAction(),
new DoAction(UIBundle.message("replace.prompt.all.in.this.file.button"), FindManager.PromptResult.ALL_IN_THIS_FILE),
new DoAction(UIBundle.message("replace.prompt.skip.all.in.file.button"), FindManager.PromptResult.SKIP_ALL_IN_THIS_FILE),
new DoAction(UIBundle.message("replace.prompt.all.files.action"), FindManager.PromptResult.ALL_FILES),
getCancelAction()
};
@@ -22,7 +22,8 @@ collapsible.panel.expanded.state.tooltip.text=Collapse Panel
idea.blue.metal.theme.name=beg blue
replace.prompt.replace.button=&Replace
replace.prompt.skip.button=&Skip
replace.prompt.all.in.this.file.button=All in This &File
replace.prompt.skip.all.in.file.button=Skip To &Next File
replace.prompt.all.in.this.file.button=Replace All in This &File
replace.prompt.all.files.action=&All Files
replace.prompt.review.action=Re&view
replace.prompt.all.button=&All