use of com.intellij.vcs.log.ui.filter.BranchPopupBuilder in project intellij-community by JetBrains.
the class DeepCompareAction method selectBranchAndPerformAction.
private static void selectBranchAndPerformAction(@NotNull VcsLogDataPack dataPack, @NotNull AnActionEvent event, @NotNull final Consumer<String> consumer, @NotNull Collection<VirtualFile> visibleRoots) {
ActionGroup actionGroup = new BranchPopupBuilder(dataPack, visibleRoots, null) {
@NotNull
@Override
protected AnAction createAction(@NotNull final String name) {
return new DumbAwareAction(name) {
@Override
public void actionPerformed(AnActionEvent e) {
consumer.consume(name);
}
};
}
}.build();
ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup("Select branch to compare", actionGroup, event.getDataContext(), false, false, false, null, -1, null);
InputEvent inputEvent = event.getInputEvent();
if (inputEvent instanceof MouseEvent) {
popup.show(new RelativePoint((MouseEvent) inputEvent));
} else {
popup.showInBestPositionFor(event.getDataContext());
}
}
Aggregations