use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class GoToHashOrRefAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
VcsLogUtil.triggerUsage(e);
Project project = e.getRequiredData(CommonDataKeys.PROJECT);
VcsLog log = e.getRequiredData(VcsLogDataKeys.VCS_LOG);
VcsLogUi ui = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
assert ui instanceof AbstractVcsLogUi;
AbstractVcsLogUi logUi = (AbstractVcsLogUi) ui;
Set<VirtualFile> visibleRoots = VcsLogUtil.getVisibleRoots(logUi);
GoToHashOrRefPopup popup = new GoToHashOrRefPopup(project, logUi.getDataPack().getRefs(), visibleRoots, log::jumpToReference, vcsRef -> logUi.jumpToCommit(vcsRef.getCommitHash(), vcsRef.getRoot()), logUi.getColorManager(), new VcsGoToRefComparator(logUi.getDataPack().getLogProviders()));
popup.show(logUi.getTable());
}
use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class IntelliSortChooserPopupAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
VcsLogUi logUI = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
VcsLogUiProperties properties = e.getRequiredData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
ActionGroup settingsGroup = new DefaultActionGroup(ContainerUtil.map(PermanentGraph.SortType.values(), (Function<PermanentGraph.SortType, AnAction>) sortType -> new SelectIntelliSortTypeAction(logUI, properties, sortType)));
ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(null, settingsGroup, e.getDataContext(), JBPopupFactory.ActionSelectionAid.MNEMONICS, true, ToolWindowContentUi.POPUP_PLACE);
Component component = e.getInputEvent().getComponent();
if (component instanceof ActionButtonComponent) {
popup.showUnderneathOf(component);
} else {
popup.showInCenterOf(component);
}
}
use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class IntelliSortChooserToggleAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
VcsLogUi logUI = e.getData(VcsLogDataKeys.VCS_LOG_UI);
VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
e.getPresentation().setVisible(BekUtil.isBekEnabled());
e.getPresentation().setEnabled(BekUtil.isBekEnabled() && logUI != null);
if (properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) {
boolean off = properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.Normal;
String description = "Turn IntelliSort " + (off ? "on" : "off") + ": " + (off ? PermanentGraph.SortType.Bek.getDescription().toLowerCase() : PermanentGraph.SortType.Normal.getDescription().toLowerCase()) + ".";
e.getPresentation().setDescription(description);
e.getPresentation().setText(description);
} else {
e.getPresentation().setText(DEFAULT_TEXT);
e.getPresentation().setDescription(DEFAULT_DESCRIPTION);
}
}
use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class RefreshLogAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
VcsLogUtil.triggerUsage(e);
VcsLogManager logManager = e.getRequiredData(VcsLogInternalDataKeys.LOG_MANAGER);
// diagnostic for possible refresh problems
VcsLogUi ui = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
if (ui instanceof AbstractVcsLogUi) {
VisiblePackRefresher refresher = ((AbstractVcsLogUi) ui).getRefresher();
if (!refresher.isValid()) {
String message = "Trying to refresh invalid log tab.";
if (!logManager.getDataManager().getProgress().isRunning()) {
LOG.error(message);
} else {
LOG.warn(message);
}
refresher.setValid(true);
}
}
logManager.getDataManager().refreshSoftly(VcsLogUtil.getVisibleRoots(ui));
}
use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class ShowCommitTooltipAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
Project project = e.getProject();
VcsLogUi ui = e.getData(VcsLogDataKeys.VCS_LOG_UI);
if (project == null || ui == null) {
e.getPresentation().setEnabledAndVisible(false);
} else {
e.getPresentation().setEnabledAndVisible(ui instanceof AbstractVcsLogUi && ((AbstractVcsLogUi) ui).getTable().getSelectedRowCount() == 1);
}
}
Aggregations