package com.intellij.debugger.streams.action;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;

/**
 * @author Vitaliy.Bibaev
 */
public class TraceStreamAction extends AnAction {
  private static class Holder {
    private static final JvmStreamDebuggerActionHandler HANDLER = new JvmStreamDebuggerActionHandler();
  }

  @Override
  public void actionPerformed(AnActionEvent e) {
    final Project project = e.getProject();
    if (project != null && Holder.HANDLER.isEnabled(project)) {
      Holder.HANDLER.perform(project);
    }
  }
}

@@ -418,16 +418,280 @@
 );%0A  %7D%0A%0A
+  @Override%0A  public void update(AnActionEvent e) %7B%0A    final Project project = e.getProject();%0A    if (project != null) %7B%0A      e.getPresentation().setEnabled(Holder.HANDLER.isEnabled(project));%0A      return;%0A    %7D%0A    e.getPresentation().setEnabled(false);%0A  %7D%0A%0A
   @Overr

Disable the action on the debug toolbar if there is no stream call