enable in-place replace action for Analyze Stacktrace (IDEA-CR-9987)
[idea/community.git] / platform / platform-impl / src / com / intellij / execution / impl / ConsoleViewUtil.java
index 5453bc1e579212246cbab6fb42cabd758e573e06..00020f5ada4736de6166a47fb9912dd263da303a 100644 (file)
@@ -54,7 +54,7 @@ import static com.intellij.execution.ui.ConsoleViewContentType.registerNewConsol
 public class ConsoleViewUtil {
 
   public static final Key<Boolean> EDITOR_IS_CONSOLE_VIEW = Key.create("EDITOR_IS_CONSOLE_VIEW");
-
+  private static final Key<Boolean> REPLACE_ACTION_ENABLED = Key.create("REPLACE_ACTION_ENABLED");
 
   public static EditorEx setupConsoleEditor(Project project, final boolean foldingOutlineShown, final boolean lineMarkerAreaShown) {
     EditorFactory editorFactory = EditorFactory.getInstance();
@@ -141,6 +141,14 @@ public class ConsoleViewUtil {
     return editor.getUserData(EDITOR_IS_CONSOLE_VIEW) == Boolean.TRUE;
   }
 
+  public static boolean isReplaceActionEnabledForConsoleViewEditor(@NotNull Editor editor) {
+    return editor.getUserData(REPLACE_ACTION_ENABLED) == Boolean.TRUE;
+  }
+
+  public static void enableReplaceActionForConsoleViewEditor(@NotNull Editor editor) {
+    editor.putUserData(REPLACE_ACTION_ENABLED, true);
+  }
+
   @SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
   private static class ColorCache {
     static {