DefaultActionGroup (DefaultActionGroup actionGroup, DataContext dataContext, @NotNull Project project) { final DefaultActionGroup copy = new DefaultActionGroup(); for (final AnAction action : actionGroup.getChildren(null)) { if (DumbService.isDumb(project) && !action.isDumbAware()) { continue; } if (action instanceof GenerateActionPopupTemplateInjector) { final AnAction editTemplateAction = ((GenerateActionPopupTemplateInjector)action).createEditTemplateAction(dataContext); if (editTemplateAction != null) { copy.add(new GenerateWrappingGroup(action, editTemplateAction)); continue; } } if (action instanceof DefaultActionGroup) { copy.add(wrapGroup((DefaultActionGroup)action, dataContext, project)); } else { copy.add(action); } } return copy; }