Platform: LaF usages collector

This commit is contained in:
Anton Makeev
2012-09-25 10:46:35 +02:00
parent 2a69206adc
commit db73ee1ae1
2 changed files with 32 additions and 0 deletions
@@ -0,0 +1,31 @@
package com.intellij.internal.statistic.ideSettings;
import com.intellij.ide.ui.LafManager;
import com.intellij.internal.statistic.CollectUsagesException;
import com.intellij.internal.statistic.UsagesCollector;
import com.intellij.internal.statistic.beans.GroupDescriptor;
import com.intellij.internal.statistic.beans.UsageDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.SystemInfo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.util.Collections;
import java.util.Set;
public class LaFUsagesCollector extends UsagesCollector {
@NotNull
@Override
public Set<UsageDescriptor> getUsages(@Nullable Project project) throws CollectUsagesException {
UIManager.LookAndFeelInfo laf = LafManager.getInstance().getCurrentLookAndFeel();
return laf != null ? Collections.singleton(new UsageDescriptor(SystemInfo.OS_NAME + " - " + laf.getName(), 1))
: Collections.<UsageDescriptor>emptySet();
}
@NotNull
@Override
public GroupDescriptor getGroupId() {
return GroupDescriptor.create("Look and Feel");
}
}
@@ -247,6 +247,7 @@
<statistics.usagesCollector implementation="com.intellij.openapi.vcs.statistics.VcsUsagesCollector"/>
<statistics.usagesCollector implementation="com.intellij.internal.statistic.UsageTrigger$MyCollector"/>
<statistics.usagesCollector implementation="com.intellij.internal.statistic.ideSettings.IdeSettingsUsagesCollector"/>
<statistics.usagesCollector implementation="com.intellij.internal.statistic.ideSettings.LaFUsagesCollector"/>
<applicationConfigurable instance="com.intellij.internal.statistic.configurable.StatisticsConfigurable" id="usage.statistics"
displayName="Usage Statistics"/>