Search in sources :

Example 1 with ChangesBrowser

use of com.intellij.openapi.vcs.changes.ui.ChangesBrowser in project intellij-community by JetBrains.

the class VcsDiffUtil method showChangesDialog.

@CalledInAwt
public static void showChangesDialog(@NotNull Project project, @NotNull String title, @NotNull List<Change> changes) {
    DialogBuilder dialogBuilder = new DialogBuilder(project);
    dialogBuilder.setTitle(title);
    dialogBuilder.setActionDescriptors(new DialogBuilder.CloseDialogAction());
    final ChangesBrowser changesBrowser = new ChangesBrowser(project, null, changes, null, false, true, null, ChangesBrowser.MyUseCase.COMMITTED_CHANGES, null);
    changesBrowser.setChangesToDisplay(changes);
    dialogBuilder.setCenterPanel(changesBrowser);
    dialogBuilder.setPreferredFocusComponent(changesBrowser.getPreferredFocusedComponent());
    dialogBuilder.setDimensionServiceKey("VcsDiffUtil.ChangesDialog");
    dialogBuilder.showNotModal();
}
Also used : ChangesBrowser(com.intellij.openapi.vcs.changes.ui.ChangesBrowser) DialogBuilder(com.intellij.openapi.ui.DialogBuilder) CalledInAwt(org.jetbrains.annotations.CalledInAwt)

Example 2 with ChangesBrowser

use of com.intellij.openapi.vcs.changes.ui.ChangesBrowser in project intellij-community by JetBrains.

the class GitCompareBranchesDiffPanel method createCenterPanel.

private JComponent createCenterPanel() {
    List<Change> diff = myCompareInfo.getTotalDiff();
    final ChangesBrowser changesBrowser = new ChangesBrowser(myProject, null, diff, null, false, true, null, ChangesBrowser.MyUseCase.COMMITTED_CHANGES, null);
    changesBrowser.setChangesToDisplay(diff);
    return changesBrowser;
}
Also used : ChangesBrowser(com.intellij.openapi.vcs.changes.ui.ChangesBrowser) Change(com.intellij.openapi.vcs.changes.Change)

Example 3 with ChangesBrowser

use of com.intellij.openapi.vcs.changes.ui.ChangesBrowser 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)

Example 4 with ChangesBrowser

use of com.intellij.openapi.vcs.changes.ui.ChangesBrowser in project intellij-community by JetBrains.

the class ChangeGoToChangePopupAction method createPopup.

@NotNull
@Override
protected JBPopup createPopup(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    if (project == null)
        project = ProjectManager.getInstance().getDefaultProject();
    Ref<JBPopup> popup = new Ref<>();
    ChangesBrowser cb = new MyChangesBrowser(project, getChanges(), getCurrentSelection(), popup);
    popup.set(JBPopupFactory.getInstance().createComponentPopupBuilder(cb, cb.getPreferredFocusedComponent()).setResizable(true).setModalContext(false).setFocusable(true).setRequestFocus(true).setCancelOnWindowDeactivation(true).setCancelOnOtherWindowOpen(true).setMovable(true).setCancelKeyEnabled(true).setCancelOnClickOutside(true).setDimensionServiceKey(project, "Diff.GoToChangePopup", false).createPopup());
    return popup.get();
}
Also used : Project(com.intellij.openapi.project.Project) Ref(com.intellij.openapi.util.Ref) ChangesBrowser(com.intellij.openapi.vcs.changes.ui.ChangesBrowser) JBPopup(com.intellij.openapi.ui.popup.JBPopup) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ChangesBrowser (com.intellij.openapi.vcs.changes.ui.ChangesBrowser)4 Project (com.intellij.openapi.project.Project)1 DialogBuilder (com.intellij.openapi.ui.DialogBuilder)1 Splitter (com.intellij.openapi.ui.Splitter)1 JBPopup (com.intellij.openapi.ui.popup.JBPopup)1 Ref (com.intellij.openapi.util.Ref)1 Change (com.intellij.openapi.vcs.changes.Change)1 GitCommitListPanel (git4idea.ui.GitCommitListPanel)1 CalledInAwt (org.jetbrains.annotations.CalledInAwt)1 NotNull (org.jetbrains.annotations.NotNull)1