use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class CollapseOrExpandGraphAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
VcsLogUi ui = e.getData(VcsLogDataKeys.VCS_LOG_UI);
VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
if (ui != null && ui.areGraphActionsEnabled() && properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) {
e.getPresentation().setEnabled(true);
if (!ui.getFilterUi().getFilters().getDetailsFilters().isEmpty()) {
e.getPresentation().setEnabled(false);
}
if (properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.LinearBek) {
e.getPresentation().setText(getPrefix() + MERGES);
e.getPresentation().setDescription(getPrefix() + MERGES_DESCRIPTION);
} else {
e.getPresentation().setText(getPrefix() + LINEAR_BRANCHES);
e.getPresentation().setDescription(getPrefix() + LINEAR_BRANCHES_DESCRIPTION);
}
} else {
e.getPresentation().setEnabled(false);
}
e.getPresentation().setText(getPrefix() + LINEAR_BRANCHES);
e.getPresentation().setDescription(getPrefix() + LINEAR_BRANCHES_DESCRIPTION);
if (isIconHidden(e)) {
e.getPresentation().setIcon(null);
} else {
e.getPresentation().setIcon(properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE) && properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.LinearBek ? getMergesIcon() : getBranchesIcon());
}
}
use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class FocusTextFilterAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
Project project = e.getProject();
VcsLogUi ui = e.getData(VcsLogDataKeys.VCS_LOG_UI);
e.getPresentation().setEnabledAndVisible(project != null && ui != null && ui instanceof VcsLogUiImpl);
}
use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class CollapseOrExpandGraphAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
VcsLogUtil.triggerUsage(e);
VcsLogUi ui = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
executeAction((VcsLogUiImpl) ui);
}
use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class EnableMatchCaseAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
VcsLogUi ui = e.getData(VcsLogDataKeys.VCS_LOG_UI);
VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
if (ui != null && properties != null && properties.exists(MainVcsLogUiProperties.TEXT_FILTER_MATCH_CASE)) {
boolean regexEnabled = properties.exists(MainVcsLogUiProperties.TEXT_FILTER_REGEX) && properties.get(MainVcsLogUiProperties.TEXT_FILTER_REGEX);
if (!regexEnabled) {
e.getPresentation().setText(MATCH_CASE);
} else {
Collection<VcsLogProvider> providers = ContainerUtil.newLinkedHashSet(ui.getDataPack().getLogProviders().values());
List<VcsLogProvider> supported = ContainerUtil.filter(providers, p -> VcsLogProperties.get(p, VcsLogProperties.CASE_INSENSITIVE_REGEX));
e.getPresentation().setVisible(true);
e.getPresentation().setEnabled(!supported.isEmpty());
if (providers.size() == supported.size() || supported.isEmpty()) {
e.getPresentation().setText(MATCH_CASE);
} else {
String supportedText = StringUtil.join(ContainerUtil.map(supported, p -> p.getSupportedVcs().getName().toLowerCase()), ", ");
e.getPresentation().setText(MATCH_CASE + " (" + supportedText + " only)");
}
}
}
}
use of com.intellij.vcs.log.VcsLogUi in project intellij-community by JetBrains.
the class VcsLogActionPromoter method promote.
@Override
public List<AnAction> promote(@NotNull List<AnAction> actions, @NotNull DataContext context) {
List<AnAction> promoted = ContainerUtil.newArrayList();
VcsLogUi ui = VcsLogDataKeys.VCS_LOG_UI.getData(context);
if (ui != null && ui instanceof FileHistoryUi) {
CompareRevisionsFromHistoryAction compareAction = ContainerUtil.findInstance(actions, CompareRevisionsFromHistoryAction.class);
if (compareAction != null)
promoted.add(compareAction);
}
return promoted;
}
Aggregations