@Nonnull private List<AnAction> mergeConsoleActions(@Nonnull List<AnAction> actions1, @Nonnull Collection<AnAction> actions2) { return ContainerUtil.map(actions1, action1 -> { final AnAction action2 = ContainerUtil.find(actions2, action -> action1.getClass() == action.getClass() && StringUtil.equals(action1.getTemplatePresentation().getText(), action.getTemplatePresentation().getText())); if (action2 instanceof ToggleUseSoftWrapsToolbarAction) { return new MergedWrapTextAction(((ToggleUseSoftWrapsToolbarAction)action1), (ToggleUseSoftWrapsToolbarAction)action2); } else if (action2 instanceof ScrollToTheEndToolbarAction) { return new MergedToggleAction(((ToggleAction)action1), (ToggleAction)action2); } else if (action2 instanceof ConsoleViewImpl.ClearAllAction) { return new MergedAction(action1, action2); } else { return action1; } }); }
private MergedWrapTextAction(@Nonnull ToggleUseSoftWrapsToolbarAction action1, @Nonnull ToggleUseSoftWrapsToolbarAction action2) { super(action1, action2); }