Search in sources :

Example 1 with VcsLogHighlighterFactory

use of com.intellij.vcs.log.ui.highlighters.VcsLogHighlighterFactory in project intellij-community by JetBrains.

the class VcsLogFeaturesCollector method getProjectUsages.

@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
    VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
    if (projectLog != null) {
        VcsLogUiImpl ui = projectLog.getMainLogUi();
        if (ui != null) {
            MainVcsLogUiProperties properties = ui.getProperties();
            Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
            usages.add(StatisticsUtilKt.getBooleanUsage("ui.details", properties.get(CommonUiProperties.SHOW_DETAILS)));
            usages.add(StatisticsUtilKt.getBooleanUsage("ui.long.edges", properties.get(SHOW_LONG_EDGES)));
            PermanentGraph.SortType sortType = properties.get(BEK_SORT_TYPE);
            usages.add(StatisticsUtilKt.getBooleanUsage("ui.sort.linear.bek", sortType.equals(PermanentGraph.SortType.LinearBek)));
            usages.add(StatisticsUtilKt.getBooleanUsage("ui.sort.bek", sortType.equals(PermanentGraph.SortType.Bek)));
            usages.add(StatisticsUtilKt.getBooleanUsage("ui.sort.normal", sortType.equals(PermanentGraph.SortType.Normal)));
            if (ui.isMultipleRoots()) {
                usages.add(StatisticsUtilKt.getBooleanUsage("ui.roots", properties.get(SHOW_ROOT_NAMES)));
            }
            usages.add(StatisticsUtilKt.getBooleanUsage("ui.labels.compact", properties.get(COMPACT_REFERENCES_VIEW)));
            usages.add(StatisticsUtilKt.getBooleanUsage("ui.labels.showTagNames", properties.get(SHOW_TAG_NAMES)));
            usages.add(StatisticsUtilKt.getBooleanUsage("ui.textFilter.regex", properties.get(TEXT_FILTER_REGEX)));
            usages.add(StatisticsUtilKt.getBooleanUsage("ui.textFilter.matchCase", properties.get(TEXT_FILTER_MATCH_CASE)));
            for (VcsLogHighlighterFactory factory : Extensions.getExtensions(LOG_HIGHLIGHTER_FACTORY_EP, project)) {
                if (factory.showMenuItem()) {
                    VcsLogHighlighterProperty property = VcsLogHighlighterProperty.get(factory.getId());
                    usages.add(StatisticsUtilKt.getBooleanUsage("ui.highlighter." + ConvertUsagesUtil.ensureProperKey(factory.getId()), properties.exists(property) && properties.get(property)));
                }
            }
            return usages;
        }
    }
    return Collections.emptySet();
}
Also used : MainVcsLogUiProperties(com.intellij.vcs.log.impl.MainVcsLogUiProperties) VcsLogHighlighterFactory(com.intellij.vcs.log.ui.highlighters.VcsLogHighlighterFactory) VcsProjectLog(com.intellij.vcs.log.impl.VcsProjectLog) VcsLogUiImpl(com.intellij.vcs.log.ui.VcsLogUiImpl) UsageDescriptor(com.intellij.internal.statistic.beans.UsageDescriptor) PermanentGraph(com.intellij.vcs.log.graph.PermanentGraph) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

UsageDescriptor (com.intellij.internal.statistic.beans.UsageDescriptor)1 PermanentGraph (com.intellij.vcs.log.graph.PermanentGraph)1 MainVcsLogUiProperties (com.intellij.vcs.log.impl.MainVcsLogUiProperties)1 VcsProjectLog (com.intellij.vcs.log.impl.VcsProjectLog)1 VcsLogUiImpl (com.intellij.vcs.log.ui.VcsLogUiImpl)1 VcsLogHighlighterFactory (com.intellij.vcs.log.ui.highlighters.VcsLogHighlighterFactory)1 NotNull (org.jetbrains.annotations.NotNull)1