ActionGroup () { Set<VirtualFile> roots = getAllRoots(); List<SelectVisibleRootAction> rootActions = new ArrayList<>(); if (myColorManager.hasMultiplePaths()) { for (VirtualFile root : ContainerUtil.sorted(roots, FILE_BY_NAME_COMPARATOR)) { rootActions.add(new SelectVisibleRootAction(root, rootActions)); } } List<AnAction> structureActions = new ArrayList<>(); for (VcsLogStructureFilter filter : getRecentFilters()) { structureActions.add(new SelectFromHistoryAction(filter)); } List<AnAction> actionsList = new ArrayList<>(Arrays.asList(new EditPathsAction(), new SelectPathsInTreeAction(), new Separator(VcsLogBundle.messagePointer("vcs.log.filter.recent")), new DefaultActionGroup(structureActions))); int position = roots.size() > 15 ? actionsList.size() : actionsList.size() - 2; actionsList.addAll(position, List.of(new Separator(VcsLogBundle.messagePointer("vcs.log.filter.roots")), new DefaultActionGroup(rootActions))); return new DefaultActionGroup(actionsList); }