@Override
  public void update(@NotNull AnActionEvent event){
    Presentation presentation = event.getPresentation();
    boolean available = isActionAvailable(event);
    if (ActionPlaces.isPopupPlace(event.getPlace())) {
      presentation.setEnabledAndVisible(available);
    }
    else {
      presentation.setEnabled(available);
    }
  }
@Override
  public void update(@NotNull AnActionEvent event)