@Override
  public void update(@NotNull AnActionEvent e) {
    Presentation presentation = e.getPresentation();
    if (JdkEx.isTabbingModeAvailable()) {
      presentation.setVisible(true);
      IdeFrame[] frames = WindowManager.getInstance().getAllProjectFrames();
      if (frames.length > 1) {
        ID id = MacUtil.getWindowFromJavaWindow((((ProjectFrameHelper)frames[0]).getFrame()));
        int tabs = Foundation.invoke(Foundation.invoke(id, "tabbedWindows"), "count").intValue();
        presentation.setEnabled(frames.length != tabs);
      }
      else {
        presentation.setEnabled(false);
      }
    }
    else {
      presentation.setEnabledAndVisible(false);
    }
    super.update(e);
  }
@Override
  public void update(@NotNull AnActionEvent e)