@Override
  public void update(@NotNull AnActionEvent e) {
    if (ActionPlaces.MAIN_MENU.equals(e.getPlace())) {
      // In the main menu the main action is hidden, instead a child to the current layout submenu is added.
      e.getPresentation().setVisible(false);
    }
    e.getPresentation().setEnabled(e.getProject() != null);
    String activeLayout = ToolWindowDefaultLayoutManager.getInstance().getActiveLayoutName();
    e.getPresentation().setDescription(
      ToolWindowDefaultLayoutManager.FACTORY_DEFAULT_LAYOUT_NAME.equals(activeLayout)
      ? ActionsBundle.message("action.RestoreFactoryDefaultLayout.description")
      : ActionsBundle.message("action.RestoreDefaultLayout.named.description", activeLayout)
    );
  }
@Override
  public void update(@NotNull AnActionEvent e)