ArrayList<AnAction> (final boolean fromPopup) { ArrayList<AnAction> actions = new ArrayList<>(); actions.add(new AbstractAddGroup(CommonBundle.message("button.add")) { @Override public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e) { return AddFacetOfTypeAction.createAddFacetActions(FacetStructureConfigurable.this); } }); if (fromPopup) { actions.add(new MyNavigateAction()); } actions.add(new MyRemoveAction()); if (fromPopup) { actions.add(Separator.getInstance()); addCollapseExpandActions(actions); } return actions; }