void () { removeAll(); for (final @NlsSafe String separator : myPredefinedSeparators) { if (separator.equals(getCurrentSeparator())) continue; AnAction action = new AnAction() { @Override public void actionPerformed(@NotNull AnActionEvent e) { ((PropertiesGroupingStructureViewModel)getTreeModel()).setSeparator(separator); setActionActive(GroupByWordPrefixes.ID, true); refillActionGroup(); rebuild(); } }; action.getTemplatePresentation().setText(separator, false); add(action); } add(new SelectSeparatorAction()); }