private static void updateForToolWindow(DataContext dataContext, Presentation presentation) {
    PsiElement[] elements = LangDataKeys.PSI_ELEMENT_ARRAY.getData(dataContext);
    Ref<@NlsActions.ActionText String> actionName = new Ref<>();
    presentation.setEnabled(elements != null && CopyHandler.canCopy(elements, actionName));
    if (!actionName.isNull()) {
      presentation.setText(actionName.get());
    }
  }
private static void updateForToolWindow(DataContext dataContext, Presentation presentation)