use of com.intellij.vcs.log.impl.VcsLogUiProperties 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.impl.VcsLogUiProperties in project intellij-community by JetBrains.
the class IntelliSortChooserPopupAction method update.
@Override
public void update(AnActionEvent e) {
super.update(e);
VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
e.getPresentation().setEnabled(properties != null);
if (properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) {
String description = "IntelliSort: " + properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE).getName();
e.getPresentation().setDescription(description);
e.getPresentation().setText(description);
}
}
use of com.intellij.vcs.log.impl.VcsLogUiProperties in project intellij-community by JetBrains.
the class IntelliSortChooserToggleAction method setSelected.
@Override
public void setSelected(AnActionEvent e, boolean state) {
VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES);
if (properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) {
PermanentGraph.SortType bekSortType = state ? PermanentGraph.SortType.Bek : PermanentGraph.SortType.Normal;
properties.set(MainVcsLogUiProperties.BEK_SORT_TYPE, bekSortType);
}
}
Aggregations