Search in sources :

Example 1 with GitCommitListPanel

use of git4idea.ui.GitCommitListPanel in project intellij-community by JetBrains.

the class GitCompareBranchesLogPanel method createCenterPanel.

private JComponent createCenterPanel() {
    final ChangesBrowser changesBrowser = new ChangesBrowser(myProject, null, Collections.<Change>emptyList(), null, false, true, null, ChangesBrowser.MyUseCase.COMMITTED_CHANGES, null);
    myHeadToBranchListPanel = new GitCommitListPanel(getHeadToBranchCommits(myInitialRepo), String.format("Branch %s is fully merged to %s", myBranchName, myCurrentBranchName));
    myBranchToHeadListPanel = new GitCommitListPanel(getBranchToHeadCommits(myInitialRepo), String.format("Branch %s is fully merged to %s", myCurrentBranchName, myBranchName));
    addSelectionListener(myHeadToBranchListPanel, myBranchToHeadListPanel, changesBrowser);
    addSelectionListener(myBranchToHeadListPanel, myHeadToBranchListPanel, changesBrowser);
    myHeadToBranchListPanel.registerDiffAction(changesBrowser.getDiffAction());
    myBranchToHeadListPanel.registerDiffAction(changesBrowser.getDiffAction());
    JPanel htb = layoutCommitListPanel(myCurrentBranchName, true);
    JPanel bth = layoutCommitListPanel(myCurrentBranchName, false);
    JPanel listPanel = null;
    switch(getInfoType()) {
        case HEAD_TO_BRANCH:
            listPanel = htb;
            break;
        case BRANCH_TO_HEAD:
            listPanel = bth;
            break;
        case BOTH:
            Splitter lists = new Splitter(true, 0.5f);
            lists.setFirstComponent(htb);
            lists.setSecondComponent(bth);
            listPanel = lists;
    }
    Splitter rootPanel = new Splitter(false, 0.7f);
    rootPanel.setSecondComponent(changesBrowser);
    rootPanel.setFirstComponent(listPanel);
    return rootPanel;
}
Also used : ChangesBrowser(com.intellij.openapi.vcs.changes.ui.ChangesBrowser) Splitter(com.intellij.openapi.ui.Splitter) GitCommitListPanel(git4idea.ui.GitCommitListPanel)

Aggregations

Splitter (com.intellij.openapi.ui.Splitter)1 ChangesBrowser (com.intellij.openapi.vcs.changes.ui.ChangesBrowser)1 GitCommitListPanel (git4idea.ui.GitCommitListPanel)1