@Override
  protected @NotNull DefaultActionGroup createPopupActionGroup(@NotNull JComponent button, @NotNull DataContext dataContext) {
    Presentation presentation = (Presentation)button.getClientProperty(PRESENTATION);
    DefaultActionGroup group = new DefaultActionGroup();
    GuiEditor editor = FormEditingUtil.getActiveEditor(dataContext);
    if (editor != null) {
      Locale[] locales = FormEditingUtil.collectUsedLocales(editor.getModule(), editor.getRootContainer());
      if (locales.length > 1 || (locales.length == 1 && !locales[0].getDisplayName().isEmpty())) {
        Arrays.sort(locales, Comparator.comparing(Locale::getDisplayName));
        for (Locale locale : locales) {
          group.add(new SetLocaleAction(editor, locale) {
            @Override
            public void actionPerformed(@NotNull AnActionEvent e) {
              super.actionPerformed(e);
              presentation.setText(getTemplatePresentation().getText());
            }
          });
        }
      }
      else {
        group.add(new SetLocaleAction(editor, new Locale("")));
      }
    }
    return group;
  }
@Override
  protected @NotNull DefaultActionGroup createPopupActionGroup(@NotNull JComponent button, @NotNull DataContext dataContext)