@Override
  public void update(final @NotNull AnActionEvent e) {
    super.update(e);
    CaptionSelection selection = e.getData(CaptionSelection.DATA_KEY);
    if (selection != null) {
      e.getPresentation().setEnabled(selection.getContainer() != null &&
        selection.getContainer().getLayout() instanceof FormLayout &&
        getCellsToGroup(selection).length > 1 &&
        !isGrouped(selection));
    }
  }
@Override
  public void update(final @NotNull AnActionEvent e)