mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-97166 Replace in Path replaces all occurences on line instead of current occurrence
This commit is contained in:
+1
-1
@@ -150,7 +150,7 @@ public class ReplaceInProjectManager {
|
||||
FindUsagesProcessPresentation processPresentation,
|
||||
final FindManager findManager) {
|
||||
final ReplaceContext[] context = new ReplaceContext[1];
|
||||
|
||||
presentation.setDupLinesFilterAvailable(false);
|
||||
manager.searchAndShowUsages(new UsageTarget[]{new FindInProjectUtil.StringUsageTarget(findModelCopy.getStringToFind())},
|
||||
usageSearcherFactory, processPresentation, presentation, new UsageViewManager.UsageViewStateListener() {
|
||||
@Override
|
||||
|
||||
@@ -44,6 +44,7 @@ public class UsageViewPresentation {
|
||||
private List<Action> myNotFoundActions;
|
||||
private boolean myDetachedMode; // no UI will be shown
|
||||
private String myDynamicCodeUsagesString;
|
||||
private boolean myDupLinesFilterAvailable = true;
|
||||
|
||||
public String getTabText() {
|
||||
return myTabText;
|
||||
@@ -174,5 +175,13 @@ public class UsageViewPresentation {
|
||||
public String getDynamicCodeUsagesString() {
|
||||
return myDynamicCodeUsagesString;
|
||||
}
|
||||
|
||||
public boolean isDupLinesFilterAvailable() {
|
||||
return myDupLinesFilterAvailable;
|
||||
}
|
||||
|
||||
public void setDupLinesFilterAvailable(boolean dupLinesFilterAvailable) {
|
||||
myDupLinesFilterAvailable = dupLinesFilterAvailable;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -469,9 +469,12 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
|
||||
|
||||
public void addFilteringActions(@NotNull DefaultActionGroup group) {
|
||||
final JComponent component = getComponent();
|
||||
final MergeDupLines mergeDupLines = new MergeDupLines();
|
||||
mergeDupLines.registerCustomShortcutSet(mergeDupLines.getShortcutSet(), component, this);
|
||||
group.add(mergeDupLines);
|
||||
|
||||
if (getPresentation().isDupLinesFilterAvailable()) {
|
||||
final MergeDupLines mergeDupLines = new MergeDupLines();
|
||||
mergeDupLines.registerCustomShortcutSet(mergeDupLines.getShortcutSet(), component, this);
|
||||
group.add(mergeDupLines);
|
||||
}
|
||||
|
||||
final UsageFilteringRuleProvider[] providers = Extensions.getExtensions(UsageFilteringRuleProvider.EP_NAME);
|
||||
for (UsageFilteringRuleProvider provider : providers) {
|
||||
|
||||
Reference in New Issue
Block a user