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();
}
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;
}
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;
}
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();
}
Aggregations