[dbe] Enable ctrl+F search on Extractor View
authorLiudmila Kornilova <kornilova203@gmail.com>
Tue, 25 Feb 2020 12:10:23 +0000 (15:10 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Tue, 25 Feb 2020 13:33:01 +0000 (13:33 +0000)
GitOrigin-RevId: 51a81ddef68ac42bf72387df7898c4c1c94505eb

platform/lang-impl/src/com/intellij/find/EditorSearchSession.java

index ab1d8b230e8b144c8e358f698fcf1e60dcc595a4..1970abf02194424697ac4d12c80708a1cb996bb6 100644 (file)
@@ -92,20 +92,8 @@ public class EditorSearchSession implements SearchSession,
 
     myComponent = SearchReplaceComponent
       .buildFor(project, myEditor.getContentComponent())
-      .addPrimarySearchActions(new PrevOccurrenceAction(),
-                               new NextOccurrenceAction(),
-                               new FindAllAction(),
-                               new Separator(),
-                               new AddOccurrenceAction(),
-                               new RemoveOccurrenceAction(),
-                               new SelectAllAction(),
-                               new Separator())
-      .addSecondarySearchActions(new ToggleAnywhereAction(),
-                                 new ToggleInCommentsAction(),
-                                 new ToggleInLiteralsOnlyAction(),
-                                 new ToggleExceptCommentsAction(),
-                                 new ToggleExceptLiteralsAction(),
-                                 new ToggleExceptCommentsAndLiteralsAction())
+      .addPrimarySearchActions(createPrimarySearchActions())
+      .addSecondarySearchActions(createSecondarySearchActions())
       .addPrimarySearchActions(new ToggleSelectionOnlyAction())
       .addExtraSearchActions(new ToggleMatchCase(),
                              new ToggleWholeWordsOnlyAction(),
@@ -203,6 +191,32 @@ public class EditorSearchSession implements SearchSession,
     FindUtil.triggerUsedOptionsStats(FIND_TYPE, findModel);
   }
 
+  @NotNull
+  protected AnAction[] createPrimarySearchActions() {
+    return new AnAction[]{
+      new PrevOccurrenceAction(),
+      new NextOccurrenceAction(),
+      new FindAllAction(),
+      new Separator(),
+      new AddOccurrenceAction(),
+      new RemoveOccurrenceAction(),
+      new SelectAllAction(),
+      new Separator()
+    };
+  }
+
+  @NotNull
+  protected AnAction[] createSecondarySearchActions() {
+    return new AnAction[] {
+      new ToggleAnywhereAction(),
+      new ToggleInCommentsAction(),
+      new ToggleInLiteralsOnlyAction(),
+      new ToggleExceptCommentsAction(),
+      new ToggleExceptLiteralsAction(),
+      new ToggleExceptCommentsAndLiteralsAction()
+    };
+  }
+
   private void saveInitialSelection() {
     if (mySelectionUpdatedFromSearchResults) return;
     SelectionModel selectionModel = myEditor.getSelectionModel();