Search in sources :

Example 1 with MAX_NUM

use of com.intellij.dvcs.branch.DvcsBranchPopup.MyMoreIndex.MAX_NUM in project intellij-community by JetBrains.

the class GitBranchPopup method createRepositoriesActions.

@NotNull
@Override
protected DefaultActionGroup createRepositoriesActions() {
    DefaultActionGroup popupGroup = new DefaultActionGroup(null, false);
    popupGroup.addSeparator("Repositories");
    List<ActionGroup> rootActions = DvcsUtil.sortRepositories(myRepositoryManager.getRepositories()).stream().map(repo -> new RootAction<>(repo, highlightCurrentRepo() ? myCurrentRepository : null, new GitBranchPopupActions(repo.getProject(), repo).createActions(), GitBranchUtil.getDisplayableBranchText(repo))).collect(toList());
    wrapWithMoreActionIfNeeded(myProject, popupGroup, rootActions, rootActions.size() > MAX_NUM ? DEFAULT_NUM : MAX_NUM, SHOW_ALL_REPOSITORIES);
    return popupGroup;
}
Also used : GitRepositoryManager(git4idea.repo.GitRepositoryManager) BranchActionGroupPopup.wrapWithMoreActionIfNeeded(com.intellij.dvcs.ui.BranchActionGroupPopup.wrapWithMoreActionIfNeeded) GitVcsSettings(git4idea.config.GitVcsSettings) ContainerUtil(com.intellij.util.containers.ContainerUtil) RootAction(com.intellij.dvcs.ui.RootAction) GitBranchUtil(git4idea.branch.GitBranchUtil) AbstractRepositoryManager(com.intellij.dvcs.repo.AbstractRepositoryManager) GitUtil(git4idea.GitUtil) DvcsUtil(com.intellij.dvcs.DvcsUtil) Project(com.intellij.openapi.project.Project) GitRepository(git4idea.repo.GitRepository) BranchActionGroup(com.intellij.dvcs.ui.BranchActionGroup) DvcsBranchPopup(com.intellij.dvcs.branch.DvcsBranchPopup) DEFAULT_NUM(com.intellij.dvcs.branch.DvcsBranchPopup.MyMoreIndex.DEFAULT_NUM) AnAction(com.intellij.openapi.actionSystem.AnAction) BranchActionUtil.getNumOfTopShownBranches(com.intellij.dvcs.ui.BranchActionUtil.getNumOfTopShownBranches) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) Objects(java.util.Objects) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) MAX_NUM(com.intellij.dvcs.branch.DvcsBranchPopup.MyMoreIndex.MAX_NUM) ContainerUtil.map(com.intellij.util.containers.ContainerUtil.map) NotNull(org.jetbrains.annotations.NotNull) FAVORITE_BRANCH_COMPARATOR(com.intellij.dvcs.ui.BranchActionUtil.FAVORITE_BRANCH_COMPARATOR) Condition(com.intellij.openapi.util.Condition) javax.swing(javax.swing) RootAction(com.intellij.dvcs.ui.RootAction) BranchActionGroup(com.intellij.dvcs.ui.BranchActionGroup) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

DvcsUtil (com.intellij.dvcs.DvcsUtil)1 DvcsBranchPopup (com.intellij.dvcs.branch.DvcsBranchPopup)1 DEFAULT_NUM (com.intellij.dvcs.branch.DvcsBranchPopup.MyMoreIndex.DEFAULT_NUM)1 MAX_NUM (com.intellij.dvcs.branch.DvcsBranchPopup.MyMoreIndex.MAX_NUM)1 AbstractRepositoryManager (com.intellij.dvcs.repo.AbstractRepositoryManager)1 BranchActionGroup (com.intellij.dvcs.ui.BranchActionGroup)1 BranchActionGroupPopup.wrapWithMoreActionIfNeeded (com.intellij.dvcs.ui.BranchActionGroupPopup.wrapWithMoreActionIfNeeded)1 FAVORITE_BRANCH_COMPARATOR (com.intellij.dvcs.ui.BranchActionUtil.FAVORITE_BRANCH_COMPARATOR)1 BranchActionUtil.getNumOfTopShownBranches (com.intellij.dvcs.ui.BranchActionUtil.getNumOfTopShownBranches)1 RootAction (com.intellij.dvcs.ui.RootAction)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 Project (com.intellij.openapi.project.Project)1 Condition (com.intellij.openapi.util.Condition)1 ContainerUtil (com.intellij.util.containers.ContainerUtil)1 ContainerUtil.map (com.intellij.util.containers.ContainerUtil.map)1 GitUtil (git4idea.GitUtil)1 GitBranchUtil (git4idea.branch.GitBranchUtil)1 GitVcsSettings (git4idea.config.GitVcsSettings)1