mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Feature Usages Statistics: migrate old collectors
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ import com.intellij.codeInspection.SuppressIntentionActionFromFix;
|
||||
import com.intellij.featureStatistics.FeatureUsageTracker;
|
||||
import com.intellij.featureStatistics.FeatureUsageTrackerImpl;
|
||||
import com.intellij.injected.editor.EditorWindow;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.actions.IntentionsCollector;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.IntentionsCollector;
|
||||
import com.intellij.lang.injection.InjectedLanguageManager;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.TransactionGuard;
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.ide.util.gotoByName.*;
|
||||
import com.intellij.ide.util.treeView.smartTree.TreeElement;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ui.ToolbarClicksCollector;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ToolbarClicksCollector;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.LanguagePsiElementExternalizer;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.fileTypes;
|
||||
|
||||
import com.intellij.internal.statistic.AbstractProjectsUsagesCollector;
|
||||
import com.intellij.internal.statistic.CollectUsagesException;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.project.ProjectKt;
|
||||
import com.intellij.psi.search.FileTypeIndex;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.util.NotNullFunction;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Nikolay Matveev
|
||||
*/
|
||||
public class FileTypeUsagesCollector extends AbstractProjectsUsagesCollector {
|
||||
private static final String GROUP_ID = "file-type";
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getProjectUsages(@NotNull final Project project) throws CollectUsagesException {
|
||||
final Set<FileType> usedFileTypes = new HashSet<>();
|
||||
final FileTypeManager fileTypeManager = FileTypeManager.getInstance();
|
||||
if (fileTypeManager == null) {
|
||||
throw new CollectUsagesException("Cannot get instance of FileTypeManager");
|
||||
}
|
||||
final FileType[] registeredFileTypes = fileTypeManager.getRegisteredFileTypes();
|
||||
for (final FileType fileType : registeredFileTypes) {
|
||||
if (project.isDisposed()) {
|
||||
throw new CollectUsagesException("Project is disposed");
|
||||
}
|
||||
ApplicationManager.getApplication().runReadAction(() -> {
|
||||
FileTypeIndex.processFiles(fileType, file -> {
|
||||
//skip files from .idea directory otherwise 99% of projects would have XML and PLAIN_TEXT file types
|
||||
if (!ProjectKt.getStateStore(project).isProjectFile(file)) {
|
||||
usedFileTypes.add(fileType);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}, GlobalSearchScope.projectScope(project));
|
||||
});
|
||||
}
|
||||
return ContainerUtil.map2Set(usedFileTypes, (NotNullFunction<FileType, UsageDescriptor>)fileType -> new UsageDescriptor(fileType.getName(), 1));
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -20,7 +20,7 @@ import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.ide.plugins.PluginNode;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigButtonUsages;
|
||||
import com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigButtonUsages;
|
||||
import com.intellij.openapi.extensions.PluginId;
|
||||
import com.intellij.openapi.progress.util.AbstractProgressIndicatorExBase;
|
||||
import com.intellij.openapi.ui.VerticalFlowLayout;
|
||||
|
||||
@@ -17,7 +17,7 @@ package com.intellij.ide.customize;
|
||||
|
||||
import com.intellij.ide.cloudConfig.CloudConfigProvider;
|
||||
import com.intellij.ide.startup.StartupActionScriptManager;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigButtonUsages;
|
||||
import com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigButtonUsages;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
package com.intellij.ide.customize;
|
||||
|
||||
import com.intellij.ide.plugins.PluginManager;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigButtonUsages;
|
||||
import com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigButtonUsages;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.VerticalFlowLayout;
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public abstract class UsagesCollector {
|
||||
|
||||
public static final ExtensionPointName<UsagesCollector> EP_NAME = ExtensionPointName.create("com.intellij.statistics.usagesCollector");
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus;
|
||||
|
||||
import com.intellij.featureStatistics.FeatureDescriptor;
|
||||
import com.intellij.featureStatistics.ProductivityFeaturesRegistry;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUStatisticsDifferenceSender;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class ProductivityUsageCollector extends ApplicationUsagesCollector implements FUStatisticsDifferenceSender {
|
||||
|
||||
private static final String GROUP_ID = "statistics.productivity";
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return GROUP_ID;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
|
||||
|
||||
final ProductivityFeaturesRegistry registry = ProductivityFeaturesRegistry.getInstance();
|
||||
for (String featureId : registry.getFeatureIds()) {
|
||||
final FeatureDescriptor featureDescriptor = registry.getFeatureDescriptor(featureId);
|
||||
if (featureDescriptor != null) {
|
||||
int count = featureDescriptor.getUsageCount();
|
||||
if (count > 0) {
|
||||
usages.add(new UsageDescriptor(featureId, count));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return usages;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.actions;
|
||||
|
||||
import com.intellij.ide.actions.ActionsCollector;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUStatisticsDifferenceSender;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public final class ActionUsagesCollector extends ApplicationUsagesCollector implements FUStatisticsDifferenceSender {
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
ActionsCollector.State state = ActionsCollector.getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(UsageDescriptorKeyValidator.ensureProperKey(e.getKey()), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getGroupId() {
|
||||
return "statistics.actions.performed";
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.actions;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.IntentionsCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUStatisticsDifferenceSender;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator.ensureProperKey;
|
||||
|
||||
public final class IntentionUsagesCollector extends ApplicationUsagesCollector implements FUStatisticsDifferenceSender {
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
IntentionsCollector.State state = IntentionsCollector.getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myIntentions.entrySet(), e -> new UsageDescriptor(ensureProperKey(e.getKey()), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getGroupId() {
|
||||
return "statistics.actions.intentions";
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.actions;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.MainMenuCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUStatisticsDifferenceSender;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator.ensureProperKey;
|
||||
|
||||
public final class MainMenuUsagesCollector extends ApplicationUsagesCollector implements FUStatisticsDifferenceSender {
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
MainMenuCollector.State state = MainMenuCollector.getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> {
|
||||
String key = e.getKey().replaceAll(" -> ", "-");
|
||||
return new UsageDescriptor(ensureProperKey(key), e.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getGroupId() {
|
||||
return "statistics.actions.main.menu";
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.actions.persistence;
|
||||
|
||||
public interface ActionIdProvider {
|
||||
String getId();
|
||||
}
|
||||
+1
-41
@@ -1,25 +1,17 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors.actions;
|
||||
package com.intellij.internal.statistic.collectors.fus.actions.persistence;
|
||||
|
||||
import com.intellij.ide.actions.ActionsCollector;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageLogger;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUStatisticsDifferenceSender;
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.components.RoamingType;
|
||||
import com.intellij.openapi.components.State;
|
||||
import com.intellij.openapi.components.Storage;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
@@ -56,36 +48,4 @@ public class ActionsCollectorImpl extends ActionsCollector implements Persistent
|
||||
public void loadState(@NotNull State state) {
|
||||
myState = state;
|
||||
}
|
||||
|
||||
@Deprecated // old statistics service format
|
||||
final static class ActionUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create("Actions", GroupDescriptor.HIGHER_PRIORITY);
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
State state = getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
|
||||
final static class ActionUsagesCollectorNew extends ApplicationUsagesCollector implements FUStatisticsDifferenceSender {
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
State state = getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getGroupId() {
|
||||
return "statistics.actions";
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-21
@@ -1,18 +1,15 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors.actions;
|
||||
package com.intellij.internal.statistic.collectors.fus.actions.persistence;
|
||||
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInsight.intention.IntentionActionDelegate;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ex.QuickFixWrapper;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.xmlb.annotations.MapAnnotation;
|
||||
import com.intellij.util.xmlb.annotations.Tag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -89,26 +86,10 @@ public class IntentionsCollector implements PersistentStateComponent<IntentionsC
|
||||
return ServiceManager.getService(IntentionsCollector.class);
|
||||
}
|
||||
|
||||
final static class State {
|
||||
public final static class State {
|
||||
@Tag("Intentions")
|
||||
@MapAnnotation(surroundWithTag = false, keyAttributeName = "name", valueAttributeName = "count")
|
||||
public Map<String, Integer> myIntentions = new HashMap<>();
|
||||
}
|
||||
|
||||
final static class IntentionUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create("Intentions");
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
State state = getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myIntentions.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-21
@@ -1,16 +1,13 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors.actions;
|
||||
package com.intellij.internal.statistic.collectors.fus.actions.persistence;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.impl.ActionMenu;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.xmlb.annotations.MapAnnotation;
|
||||
import com.intellij.util.xmlb.annotations.Tag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -125,25 +122,9 @@ public class MainMenuCollector implements PersistentStateComponent<MainMenuColle
|
||||
}
|
||||
|
||||
|
||||
final static class State {
|
||||
public final static class State {
|
||||
@Tag("counts")
|
||||
@MapAnnotation(surroundWithTag = false, keyAttributeName = "path", valueAttributeName = "count")
|
||||
public Map<String, Integer> myValues = new HashMap<>();
|
||||
}
|
||||
|
||||
final static class MainMenuUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create("Main Menu", GroupDescriptor.HIGHER_PRIORITY);
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
State state = getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.fileTypes;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.project.ProjectKt;
|
||||
import com.intellij.psi.search.FileTypeIndex;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.util.NotNullFunction;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Nikolay Matveev
|
||||
*/
|
||||
public class FileTypeUsagesCollector extends ProjectUsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "statistics.file.types";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages(@NotNull final Project project) {
|
||||
return getDescriptors(project);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Set<UsageDescriptor> getDescriptors(@NotNull Project project) {
|
||||
final Set<FileType> usedFileTypes = new HashSet<>();
|
||||
final FileTypeManager fileTypeManager = FileTypeManager.getInstance();
|
||||
if (fileTypeManager == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
final FileType[] registeredFileTypes = fileTypeManager.getRegisteredFileTypes();
|
||||
for (final FileType fileType : registeredFileTypes) {
|
||||
if (project.isDisposed()) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
ApplicationManager.getApplication().runReadAction(() -> {
|
||||
FileTypeIndex.processFiles(fileType, file -> {
|
||||
//skip files from .idea directory otherwise 99% of projects would have XML and PLAIN_TEXT file types
|
||||
if (!ProjectKt.getStateStore(project).isProjectFile(file)) {
|
||||
usedFileTypes.add(fileType);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}, GlobalSearchScope.projectScope(project));
|
||||
});
|
||||
}
|
||||
return ContainerUtil
|
||||
.map2Set(usedFileTypes, (NotNullFunction<FileType, UsageDescriptor>)fileType -> new UsageDescriptor(fileType.getName(), 1));
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.jdk;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.util.lang.JavaVersion;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator.ensureProperKey;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class JdkInfoUsageCollector extends ApplicationUsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
final String vendor = System.getProperty("java.vendor", "Unknown");
|
||||
final String version = "1." + JavaVersion.current().feature;
|
||||
return Collections.singleton(new UsageDescriptor(ensureProperKey(vendor + "." + version), 1));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "statistics.jdk.user";
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.os;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator.ensureProperKey;
|
||||
|
||||
public class OsNameUsageCollector extends ApplicationUsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
String osName = SystemInfo.isLinux ? "Linux" : SystemInfo.isMac ? "Mac.OS.X" : SystemInfo.isWindows ? "Windows" : SystemInfo.OS_NAME;
|
||||
return ImmutableSet.of(new UsageDescriptor(ensureProperKey(osName), 1));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() { return "statistics.os.name"; }
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.os;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.Version;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class OsVersionUsageCollector extends ApplicationUsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return getDescriptors();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Set<UsageDescriptor> getDescriptors() {
|
||||
UsageDescriptor descriptor;
|
||||
|
||||
if (SystemInfo.isLinux) {
|
||||
String releaseId = null, releaseVersion = null;
|
||||
|
||||
try {
|
||||
Map<String, String> values = Files.lines(Paths.get("/etc/os-release"))
|
||||
.map(line -> StringUtil.split(line, "="))
|
||||
.filter(parts -> parts.size() == 2)
|
||||
.collect(
|
||||
Collectors.toMap(parts -> parts.get(0), parts -> StringUtil.unquoteString(parts.get(1))));
|
||||
releaseId = values.get("ID");
|
||||
releaseVersion = values.get("VERSION_ID");
|
||||
}
|
||||
catch (IOException ignored) {
|
||||
}
|
||||
|
||||
if (releaseId == null) releaseId = "unknown";
|
||||
|
||||
if (releaseVersion == null) {
|
||||
releaseVersion = SystemInfo.OS_VERSION;
|
||||
Version version = Version.parseVersion(releaseVersion);
|
||||
if (version != null) {
|
||||
releaseVersion = version.toCompactString();
|
||||
}
|
||||
}
|
||||
|
||||
descriptor = new UsageDescriptor("Linux/" + releaseId + " " + releaseVersion, 1);
|
||||
}
|
||||
else {
|
||||
descriptor = new UsageDescriptor(UsageDescriptorKeyValidator.ensureProperKey(SystemInfo.OS_NAME + "." + SystemInfo.OS_VERSION), 1);
|
||||
}
|
||||
|
||||
return Collections.singleton(descriptor);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() { return "statistics.os.version"; }
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.plugins;
|
||||
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class DisabledPluginsUsagesCollector extends ApplicationUsagesCollector {
|
||||
|
||||
@NotNull
|
||||
public String getGroupId() {
|
||||
return "statistics.plugins.disabled";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return ContainerUtil.map2Set(PluginManagerCore.getDisabledPlugins(), descriptor -> new UsageDescriptor(descriptor, 1));
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.plugins;
|
||||
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class NonBundledPluginsUsagesCollector extends ApplicationUsagesCollector {
|
||||
@NotNull
|
||||
public String getGroupId() {
|
||||
return "statistics.plugins.non.bundled";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
final IdeaPluginDescriptor[] plugins = PluginManagerCore.getPlugins();
|
||||
final List<IdeaPluginDescriptor> nonBundledEnabledPlugins = ContainerUtil.filter(plugins, d -> d.isEnabled() && !d.isBundled() && d.getPluginId() != null);
|
||||
|
||||
return ContainerUtil.map2Set(nonBundledEnabledPlugins, descriptor -> new UsageDescriptor(descriptor.getPluginId().getIdString(), 1));
|
||||
}
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.ui;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.util.ui.accessibility.ScreenReader;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author tav
|
||||
*/
|
||||
public class A11YUsagesCollector extends ApplicationUsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
String activity = ScreenReader.isActive() ? "ENABLED" : "DISABLED";
|
||||
String os = SystemInfo.isWindows ? "Windows" : SystemInfo.isLinux ? "Linux" : SystemInfo.isMac ? "Mac" : "Unknown OS";
|
||||
return Collections.singleton(new UsageDescriptor(os + ".screen.reader." + activity, 1));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "statistics.ui.a11y.screen.reader";
|
||||
}
|
||||
}
|
||||
|
||||
+14
-24
@@ -1,26 +1,11 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.editor.colors.impl;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.ui;
|
||||
|
||||
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.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsScheme;
|
||||
import com.intellij.openapi.editor.colors.impl.AbstractColorsScheme;
|
||||
import com.intellij.openapi.options.SchemeManager;
|
||||
import com.intellij.ui.ColorUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -30,7 +15,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class EditorColorSchemesUsagesCollector extends UsagesCollector {
|
||||
public class EditorColorSchemesUsagesCollector extends ApplicationUsagesCollector {
|
||||
|
||||
public static final String GROUP_ID = "Color Schemes";
|
||||
public static final String SCHEME_NAME_OTHER = "Other";
|
||||
@@ -53,7 +38,12 @@ public class EditorColorSchemesUsagesCollector extends UsagesCollector {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return getDescriptors();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Set<UsageDescriptor> getDescriptors() {
|
||||
EditorColorsScheme currentScheme = EditorColorsManager.getInstance().getGlobalScheme();
|
||||
Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
|
||||
String schemeName = SCHEME_NAME_OTHER;
|
||||
@@ -71,7 +61,7 @@ public class EditorColorSchemesUsagesCollector extends UsagesCollector {
|
||||
schemeName = knownName;
|
||||
}
|
||||
boolean isDark = ColorUtil.isDark(currentScheme.getDefaultBackground());
|
||||
schemeName += " (" + (isDark ? "Dark" : "Light") + ")";
|
||||
schemeName += "[" + (isDark ? "Dark" : "Light") + "]";
|
||||
}
|
||||
usages.add(new UsageDescriptor(schemeName, 1));
|
||||
}
|
||||
@@ -90,8 +80,8 @@ public class EditorColorSchemesUsagesCollector extends UsagesCollector {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID);
|
||||
public String getGroupId() {
|
||||
return "statistics.ui.editor.color.schemes";
|
||||
}
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.ui
|
||||
|
||||
import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
import com.intellij.internal.statistic.CollectUsagesException
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector
|
||||
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator.ensureProperKey
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager
|
||||
import com.intellij.openapi.editor.colors.impl.AppEditorFontOptions
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
class FontSizeInfoUsageCollector : ApplicationUsagesCollector() {
|
||||
@Throws(CollectUsagesException::class)
|
||||
override fun getUsages(): Set<UsageDescriptor> {
|
||||
val scheme = EditorColorsManager.getInstance().globalScheme
|
||||
val ui = UISettings.shadowInstance
|
||||
var usages = setOf(
|
||||
UsageDescriptor("UI.font.size[${ui.fontSize}]"),
|
||||
UsageDescriptor(ensureProperKey("UI.font.name[${ui.fontFace}]")),
|
||||
UsageDescriptor("Presentation.mode.font.size[${ui.presentationModeFontSize}]")
|
||||
)
|
||||
if (!scheme.isUseAppFontPreferencesInEditor) {
|
||||
usages += setOf(
|
||||
UsageDescriptor("Editor.font.size[${scheme.editorFontSize}]"),
|
||||
UsageDescriptor(ensureProperKey("Editor.font.name[${scheme.editorFontName}]"))
|
||||
)
|
||||
}
|
||||
else {
|
||||
val appPrefs = AppEditorFontOptions.getInstance().fontPreferences
|
||||
usages += setOf(
|
||||
UsageDescriptor("IDE.editor.font.size[${appPrefs.getSize(appPrefs.fontFamily)}]"),
|
||||
UsageDescriptor(ensureProperKey("IDE.editor.font.name[${appPrefs.fontFamily}]"))
|
||||
)
|
||||
}
|
||||
if (!scheme.isUseEditorFontPreferencesInConsole) {
|
||||
usages += setOf(
|
||||
UsageDescriptor("Console.font.size[${scheme.consoleFontSize}]"),
|
||||
UsageDescriptor(ensureProperKey("Console.font.name[${scheme.consoleFontName}]"))
|
||||
)
|
||||
}
|
||||
val quickDocFontSize = PropertiesComponent.getInstance().getValue("quick.doc.font.size")
|
||||
if (quickDocFontSize != null) {
|
||||
usages += setOf(
|
||||
UsageDescriptor("QuickDoc.font.size[" + quickDocFontSize +"]")
|
||||
)
|
||||
}
|
||||
return usages
|
||||
}
|
||||
|
||||
override fun getGroupId(): String {
|
||||
return "statistics.ui.fonts"
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.ui;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author tav
|
||||
*/
|
||||
public class HiDPIModeUsagesCollector extends ApplicationUsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
String mode = UIUtil.isJreHiDPIEnabled() ? "per_monitor_dpi" : "system_dpi";
|
||||
String os = SystemInfo.isWindows ? "Windows" : SystemInfo.isLinux ? "Linux" : SystemInfo.isMac ? "Mac" : "UnknownOS";
|
||||
return Collections.singleton(new UsageDescriptor(os + "." + mode, 1));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "statistics.ui.hidpi.mode";
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.ui;
|
||||
|
||||
import com.intellij.ide.ui.LafManager;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator.ensureProperKey;
|
||||
|
||||
public class LaFUsagesCollector extends ApplicationUsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
UIManager.LookAndFeelInfo laf = LafManager.getInstance().getCurrentLookAndFeel();
|
||||
String key = SystemInfo.OS_NAME + ".";
|
||||
if (!StringUtil.isEmptyOrSpaces(SystemInfo.SUN_DESKTOP)) {
|
||||
key=key.replaceAll(" ", "_");
|
||||
key += SystemInfo.SUN_DESKTOP + ".";
|
||||
}
|
||||
return laf != null ? Collections.singleton(new UsageDescriptor(ensureProperKey(key + laf.getName()), 1))
|
||||
: Collections.emptySet();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() { return "statistics.ui.look.and.feel"; }
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.ui;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jdesktop.swingx.util.OS;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author tav
|
||||
*/
|
||||
public class ScaleInfoUsageCollector extends ApplicationUsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return getDescriptors();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Set<UsageDescriptor> getDescriptors() {
|
||||
float scale = JBUI.sysScale();
|
||||
|
||||
int scaleBase = (int)Math.floor(scale);
|
||||
float scaleFract = scale - scaleBase;
|
||||
|
||||
if (scaleFract == 0.0f) scaleFract = 0.0f; // count integer scale on a precise match only
|
||||
else if (scaleFract < 0.375f) scaleFract = 0.25f;
|
||||
else if (scaleFract < 0.625f) scaleFract = 0.5f;
|
||||
else scaleFract = 0.75f;
|
||||
|
||||
scale = scaleBase + scaleFract;
|
||||
|
||||
String os = OS.isWindows() ? "Windows" : OS.isLinux() ? "Linux" : OS.isMacOSX() ? "Mac" : "UnknownOS";
|
||||
return Collections.singleton(new UsageDescriptor(os + "_" + scale, 1));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() { return "statistics.ui.screen.scale"; }
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.ui;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ShortcutsCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUStatisticsDifferenceSender;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator.*;
|
||||
|
||||
public final class ShortcutUsagesCollector extends ApplicationUsagesCollector implements FUStatisticsDifferenceSender {
|
||||
|
||||
private static String getGroupName() {
|
||||
if (SystemInfo.isMac) return "statistics.ui.shortcuts.on.mac";
|
||||
if (SystemInfo.isWindows) return "statistics.ui.shortcuts.on.windows";
|
||||
if (SystemInfo.isLinux) return "statistics.ui.shortcuts.on.linux";
|
||||
return "statistics.ui.shortcuts.on.other.os";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
ShortcutsCollector.MyState state = ShortcutsCollector.getInstance().getState();
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(ensureProperKey(e.getKey()), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getGroupId() {
|
||||
return getGroupName();
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.ui;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ToolbarClicksCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUStatisticsDifferenceSender;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator.*;
|
||||
|
||||
public final class ToolbarClicksUsagesCollector extends ApplicationUsagesCollector implements FUStatisticsDifferenceSender {
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
ToolbarClicksCollector.ClicksState state = ToolbarClicksCollector.getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(ensureProperKey(e.getKey()), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getGroupId() {
|
||||
return "statistics.ui.toolbar.clicks";
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.fus.ui;
|
||||
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector;
|
||||
import com.intellij.openapi.editor.ex.EditorSettingsExternalizable;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import gnu.trove.THashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.utils.StatisticsUtilKt.getBooleanUsage;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class UiInfoUsageCollector extends ApplicationUsagesCollector {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return getDescriptors();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Set<UsageDescriptor> getDescriptors() {
|
||||
Set<UsageDescriptor> set = new THashSet<>();
|
||||
|
||||
add(set, "Nav.Bar.visible", navbar() ? 1 : 0);
|
||||
add(set, "Nav.Bar.floating", navbar() ? 0 : 1);
|
||||
add(set, "Toolbar.visible", toolbar() ? 1 : 0);
|
||||
add(set, "Toolbar.hidden", toolbar() ? 0 : 1);
|
||||
add(set, "Toolbar.and.NavBar", !toolbar() && navbar() ? 1 : 0);
|
||||
add(set, "Toolbar.and.NavBar.hidden", !toolbar() && !navbar() ? 1 : 0);
|
||||
add(set, "Status.bar.visible", status() ? 1 : 0);
|
||||
add(set, "Status.bar.hidden", status() ? 0 : 1);
|
||||
add(set, "Tool.Window.buttons.visible", stripes() ? 1 : 0);
|
||||
add(set, "Tool.Window.buttons.hidden", stripes() ? 0 : 1);
|
||||
add(set, "Recent.Files[15]", recent() == 15 ? 1 : 0);
|
||||
add(set, "Recent.Files[15_30]", 15 < recent() && recent() < 31 ? 1 : 0);
|
||||
add(set, "Recent.Files[30_50]", 30 < recent() && recent() < 51 ? 1 : 0);
|
||||
add(set, "Recent.Files[more.than.50]", 50 < recent() ? 1 : 0);
|
||||
add(set, "Block.cursor", EditorSettingsExternalizable.getInstance().isBlockCursor() ? 1 : 0);
|
||||
add(set, "Line.Numbers", EditorSettingsExternalizable.getInstance().isLineNumbersShown() ? 1 : 0);
|
||||
add(set, "Gutter.Icons", EditorSettingsExternalizable.getInstance().areGutterIconsShown() ? 1 : 0);
|
||||
add(set, "Soft.Wraps", EditorSettingsExternalizable.getInstance().isUseSoftWraps() ? 1 : 0);
|
||||
add(set, "Tabs.None", tabPlace() == 0 ? 1 : 0);
|
||||
add(set, "Tabs.Top", tabPlace() == SwingConstants.TOP ? 1 : 0);
|
||||
add(set, "Tabs.Bottom", tabPlace() == SwingConstants.BOTTOM ? 1 : 0);
|
||||
add(set, "Tabs.Left", tabPlace() == SwingConstants.LEFT ? 1 : 0);
|
||||
add(set, "Tabs.Right", tabPlace() == SwingConstants.RIGHT ? 1 : 0);
|
||||
add(set, "Retina", UIUtil.isRetina() ? 1 : 0);
|
||||
add(set, "Show.tips.on.startup", GeneralSettings.getInstance().isShowTipsOnStartup() ? 1 : 0);
|
||||
set.add(getBooleanUsage("Allow.merging.buttons", UISettings.getInstance().getAllowMergeButtons()));
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "statistics.ui.info.features";
|
||||
}
|
||||
|
||||
private static void add(Set<UsageDescriptor> set, String key, int value) {
|
||||
set.add(new UsageDescriptor(key, value));
|
||||
}
|
||||
|
||||
private static int tabPlace() {
|
||||
return UISettings.getInstance().getEditorTabPlacement();
|
||||
}
|
||||
|
||||
private static int recent() {
|
||||
return UISettings.getInstance().getRecentFilesLimit();
|
||||
}
|
||||
|
||||
private static boolean stripes() {
|
||||
return UISettings.getInstance().getHideToolStripes();
|
||||
}
|
||||
|
||||
private static boolean status() {
|
||||
return UISettings.getInstance().getShowStatusBar();
|
||||
}
|
||||
|
||||
private static boolean toolbar() {
|
||||
return UISettings.getInstance().getShowMainToolbar();
|
||||
}
|
||||
|
||||
private static boolean navbar() {
|
||||
return UISettings.getInstance().getShowNavigationBar();
|
||||
}
|
||||
}
|
||||
+7
-30
@@ -1,15 +1,11 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ui;
|
||||
package com.intellij.internal.statistic.collectors.fus.ui.persistence;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.KeyboardShortcut;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.xmlb.annotations.MapAnnotation;
|
||||
@@ -19,7 +15,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.swing.*;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.awt.event.InputEvent.ALT_GRAPH_MASK;
|
||||
@@ -41,7 +40,7 @@ import static java.awt.event.KeyEvent.*;
|
||||
}
|
||||
)
|
||||
public class ShortcutsCollector implements PersistentStateComponent<ShortcutsCollector.MyState> {
|
||||
final static class MyState {
|
||||
public final static class MyState {
|
||||
@Tag("counts")
|
||||
@MapAnnotation(surroundWithTag = false, keyAttributeName = "shortcut", valueAttributeName = "count")
|
||||
public final Map<String, Integer> myValues = new HashMap<>();
|
||||
@@ -104,32 +103,10 @@ public class ShortcutsCollector implements PersistentStateComponent<ShortcutsCol
|
||||
}
|
||||
|
||||
|
||||
private static ShortcutsCollector getInstance() {
|
||||
public static ShortcutsCollector getInstance() {
|
||||
return ServiceManager.getService(ShortcutsCollector.class);
|
||||
}
|
||||
|
||||
final static class ShortcutUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create(getGroupName(), GroupDescriptor.HIGHER_PRIORITY);
|
||||
|
||||
private static String getGroupName() {
|
||||
if (SystemInfo.isMac) return "Shortcuts on Mac";
|
||||
if (SystemInfo.isWindows) return "Shortcuts on Windows";
|
||||
if (SystemInfo.isLinux) return "Shortcuts on Linux";
|
||||
return "Shortcuts on OtherOs";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
MyState state = getInstance().getState();
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getLocaleUnawareKeyText(int keyCode) {
|
||||
if (keyCode >= VK_0 && keyCode <= VK_9 ||
|
||||
keyCode >= VK_A && keyCode <= VK_Z) {
|
||||
+4
-25
@@ -1,23 +1,18 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ui;
|
||||
package com.intellij.internal.statistic.collectors.fus.ui.persistence;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.ActionWithDelegate;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.xmlb.annotations.MapAnnotation;
|
||||
import com.intellij.util.xmlb.annotations.Tag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
@@ -30,7 +25,7 @@ import java.util.Set;
|
||||
}
|
||||
)
|
||||
public class ToolbarClicksCollector implements PersistentStateComponent<ToolbarClicksCollector.ClicksState> {
|
||||
final static class ClicksState {
|
||||
public final static class ClicksState {
|
||||
@Tag("counts")
|
||||
@MapAnnotation(surroundWithTag = false, keyAttributeName = "action", valueAttributeName = "count")
|
||||
public Map<String, Integer> myValues = new HashMap<>();
|
||||
@@ -71,23 +66,7 @@ public class ToolbarClicksCollector implements PersistentStateComponent<ToolbarC
|
||||
}
|
||||
}
|
||||
|
||||
private static ToolbarClicksCollector getInstance() {
|
||||
public static ToolbarClicksCollector getInstance() {
|
||||
return ServiceManager.getService(ToolbarClicksCollector.class);
|
||||
}
|
||||
|
||||
final static class ToolbarClicksUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create("Toolbar Clicks", GroupDescriptor.HIGHER_PRIORITY);
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
ClicksState state = getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
@@ -14,6 +14,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class ExperimentalFeaturesUsageCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP_ID = GroupDescriptor.create("Experimental Features");
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
@@ -13,7 +13,8 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class RegistryUsagesCollector extends UsagesCollector {
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyRegistryUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP_ID = GroupDescriptor.create("Registry");
|
||||
|
||||
@NotNull
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.actions;
|
||||
|
||||
import com.intellij.ide.actions.ActionsCollector;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Deprecated // old statistics service format
|
||||
public final class LegacyActionUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create("Actions", GroupDescriptor.HIGHER_PRIORITY);
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
ActionsCollector.State state = ActionsCollector.getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.actions;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.IntentionsCollector;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public final class LegacyIntentionUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create("Intentions");
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
IntentionsCollector.State state = IntentionsCollector.getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myIntentions.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.actions;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.MainMenuCollector;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public final class LegacyMainMenuUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create("Main Menu", GroupDescriptor.HIGHER_PRIORITY);
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
MainMenuCollector.State state = MainMenuCollector.getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
+3
-16
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.build;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.build;
|
||||
|
||||
import com.intellij.internal.statistic.CollectUsagesException;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
@@ -28,6 +14,7 @@ import java.util.Set;
|
||||
/**
|
||||
* @author Ivan Chirkov
|
||||
*/
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class BuildNumberUsageCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.fileTypes;
|
||||
|
||||
import com.intellij.internal.statistic.AbstractProjectsUsagesCollector;
|
||||
import com.intellij.internal.statistic.CollectUsagesException;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.fileTypes.FileTypeUsagesCollector;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Nikolay Matveev
|
||||
*/
|
||||
public class LegacyFileTypeUsagesCollector extends AbstractProjectsUsagesCollector {
|
||||
private static final String GROUP_ID = "file-type";
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getProjectUsages(@NotNull final Project project) throws CollectUsagesException {
|
||||
return FileTypeUsagesCollector.getDescriptors(project);
|
||||
}
|
||||
}
|
||||
+2
-16
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ideSettings;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ideSettings;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Collections;
|
||||
+3
-17
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ideSettings;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ideSettings;
|
||||
|
||||
import com.intellij.ide.WelcomeWizardUtil;
|
||||
import com.intellij.internal.statistic.CollectUsagesException;
|
||||
@@ -28,7 +14,7 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigButtonUsages.*;
|
||||
import static com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigButtonUsages.*;
|
||||
|
||||
public final class IdeInitialConfigUsageCollectors {
|
||||
public static class ConfigImport extends Base {
|
||||
+3
-16
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.jdk
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.jdk
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor
|
||||
@@ -24,6 +10,7 @@ import java.util.function.Function
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
@Deprecated("") // to be removed in 2018.2
|
||||
class JdkSettingsUsageCollector : UsagesCollector() {
|
||||
override fun getUsages(): Set<UsageDescriptor> {
|
||||
return ManagementFactory.getRuntimeMXBean().inputArguments
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors.jdk;
|
||||
package com.intellij.internal.statistic.collectors.legacy.jdk;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
@@ -13,7 +13,8 @@ import java.util.Set;
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
class JdkInfoUsageCollector extends UsagesCollector {
|
||||
@Deprecated // to be removed in 2018.2
|
||||
class LegacyJdkInfoUsageCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
+4
-17
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.os;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.os;
|
||||
|
||||
import com.intellij.internal.statistic.CollectUsagesException;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
@@ -28,7 +14,8 @@ import java.util.Set;
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
class OsNameUsageCollector extends UsagesCollector {
|
||||
@Deprecated // to be removed in 2018.2
|
||||
class LegacyOsNameUsageCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.os;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.os.OsVersionUsageCollector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
@Deprecated
|
||||
// to be removed in 2018.2
|
||||
class LegacyOsVersionUsageCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return OsVersionUsageCollector.getDescriptors();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create("user.os.version");
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.plugins;
|
||||
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyDisabledPluginsUsagesCollector extends UsagesCollector {
|
||||
private static final String GROUP_ID = "disabled-plugins";
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID, GroupDescriptor.HIGHER_PRIORITY);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return ContainerUtil.map2Set(PluginManagerCore.getDisabledPlugins(), descriptor -> new UsageDescriptor(descriptor, 1));
|
||||
}
|
||||
}
|
||||
+6
-19
@@ -1,32 +1,19 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.ide.plugins;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.plugins;
|
||||
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class NonBundledPluginsUsagesCollector extends UsagesCollector {
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyNonBundledPluginsUsagesCollector extends UsagesCollector {
|
||||
private static final String GROUP_ID = "non-bundled-plugins";
|
||||
|
||||
@NotNull
|
||||
+6
-17
@@ -1,20 +1,8 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.featureStatistics;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.productivity;
|
||||
|
||||
import com.intellij.featureStatistics.FeatureDescriptor;
|
||||
import com.intellij.featureStatistics.ProductivityFeaturesRegistry;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
@@ -23,7 +11,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class FeaturesUsageCollector extends UsagesCollector {
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyProductivityFeaturesUsageCollector extends UsagesCollector {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ui;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ui;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
@@ -14,7 +14,8 @@ import java.util.Set;
|
||||
/**
|
||||
* @author tav
|
||||
*/
|
||||
public class A11YUsagesCollector extends UsagesCollector {
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyA11YUsagesCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ui;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.EditorColorSchemesUsagesCollector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyEditorColorSchemesUsagesCollector extends UsagesCollector {
|
||||
|
||||
public static final String GROUP_ID = "Color Schemes";
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return EditorColorSchemesUsagesCollector.getDescriptors();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID);
|
||||
}
|
||||
|
||||
}
|
||||
+3
-17
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ui
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ui
|
||||
|
||||
import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
@@ -27,7 +13,7 @@ import com.intellij.openapi.editor.colors.impl.AppEditorFontOptions
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
class FontSizeInfoUsageCollector : UsagesCollector() {
|
||||
class LegacyFontSizeInfoUsageCollector : UsagesCollector() {
|
||||
@Throws(CollectUsagesException::class)
|
||||
override fun getUsages(): Set<UsageDescriptor> {
|
||||
val scheme = EditorColorsManager.getInstance().globalScheme
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ui;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ui;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
@@ -14,7 +14,8 @@ import java.util.Set;
|
||||
/**
|
||||
* @author tav
|
||||
*/
|
||||
public class HiDPIModeUsagesCollector extends UsagesCollector {
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyHiDPIModeUsagesCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
+5
-19
@@ -1,22 +1,7 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ui;
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ui;
|
||||
|
||||
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;
|
||||
@@ -28,10 +13,11 @@ import javax.swing.*;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
public class LaFUsagesCollector extends UsagesCollector {
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyLaFUsagesCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
UIManager.LookAndFeelInfo laf = LafManager.getInstance().getCurrentLookAndFeel();
|
||||
String key = SystemInfo.OS_NAME + " - ";
|
||||
if (!StringUtil.isEmptyOrSpaces(SystemInfo.SUN_DESKTOP)) {
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ui;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.ScaleInfoUsageCollector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author tav
|
||||
*/
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyScaleInfoUsageCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return ScaleInfoUsageCollector.getDescriptors();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create("user.ui.screen.scale");
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ui;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ShortcutsCollector;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public final class LegacyShortcutUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create(getGroupName(), GroupDescriptor.HIGHER_PRIORITY);
|
||||
|
||||
private static String getGroupName() {
|
||||
if (SystemInfo.isMac) return "Shortcuts on Mac";
|
||||
if (SystemInfo.isWindows) return "Shortcuts on Windows";
|
||||
if (SystemInfo.isLinux) return "Shortcuts on Linux";
|
||||
return "Shortcuts on OtherOs";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
ShortcutsCollector.MyState state = ShortcutsCollector.getInstance().getState();
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ui;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ToolbarClicksCollector;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public final class LegacyToolbarClicksUsagesCollector extends UsagesCollector {
|
||||
private static final GroupDescriptor GROUP = GroupDescriptor.create("Toolbar Clicks", GroupDescriptor.HIGHER_PRIORITY);
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
ToolbarClicksCollector.ClicksState state = ToolbarClicksCollector.getInstance().getState();
|
||||
assert state != null;
|
||||
return ContainerUtil.map2Set(state.myValues.entrySet(), e -> new UsageDescriptor(e.getKey(), e.getValue()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GROUP;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.collectors.legacy.ui;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.UiInfoUsageCollector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
@Deprecated // to be removed in 2018.2
|
||||
class LegacyUiInfoUsageCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return UiInfoUsageCollector.getDescriptors();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create("UI Features");
|
||||
}
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.actions;
|
||||
|
||||
public interface ActionIdProvider {
|
||||
String getId();
|
||||
}
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.os;
|
||||
|
||||
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.util.SystemInfo;
|
||||
import com.intellij.openapi.util.Version;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
class OsVersionUsageCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
|
||||
UsageDescriptor descriptor;
|
||||
|
||||
if (SystemInfo.isLinux) {
|
||||
String releaseId = null, releaseVersion = null;
|
||||
|
||||
try {
|
||||
Map<String, String> values = Files.lines(Paths.get("/etc/os-release"))
|
||||
.map(line -> StringUtil.split(line, "="))
|
||||
.filter(parts -> parts.size() == 2)
|
||||
.collect(Collectors.toMap(parts -> parts.get(0), parts -> StringUtil.unquoteString(parts.get(1))));
|
||||
releaseId = values.get("ID");
|
||||
releaseVersion = values.get("VERSION_ID");
|
||||
}
|
||||
catch (IOException ignored) { }
|
||||
|
||||
if (releaseId == null) releaseId = "unknown";
|
||||
|
||||
if (releaseVersion == null) {
|
||||
releaseVersion = SystemInfo.OS_VERSION;
|
||||
Version version = Version.parseVersion(releaseVersion);
|
||||
if (version != null) {
|
||||
releaseVersion = version.toCompactString();
|
||||
}
|
||||
}
|
||||
|
||||
descriptor = new UsageDescriptor("Linux/" + releaseId + " " + releaseVersion, 1);
|
||||
}
|
||||
else {
|
||||
descriptor = new UsageDescriptor(SystemInfo.OS_NAME + " " + SystemInfo.OS_VERSION, 1);
|
||||
}
|
||||
|
||||
return Collections.singleton(descriptor);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create("user.os.version");
|
||||
}
|
||||
}
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ui;
|
||||
|
||||
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.util.ui.JBUI;
|
||||
import org.jdesktop.swingx.util.OS;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author tav
|
||||
*/
|
||||
public class ScaleInfoUsageCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
|
||||
float scale = JBUI.sysScale();
|
||||
|
||||
int scaleBase = (int)Math.floor(scale);
|
||||
float scaleFract = scale - scaleBase;
|
||||
|
||||
if (scaleFract == 0.0f) scaleFract = 0.0f; // count integer scale on a precise match only
|
||||
else if (scaleFract < 0.375f) scaleFract = 0.25f;
|
||||
else if (scaleFract < 0.625f) scaleFract = 0.5f;
|
||||
else scaleFract = 0.75f;
|
||||
|
||||
scale = scaleBase + scaleFract;
|
||||
|
||||
String os = OS.isWindows() ? "Windows" : OS.isLinux() ? "Linux" : OS.isMacOSX() ? "Mac" : "Unknown OS";
|
||||
return Collections.singleton(new UsageDescriptor(os + " " + scale, 1));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create("user.ui.screen.scale");
|
||||
}
|
||||
}
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.internal.statistic.customUsageCollectors.ui;
|
||||
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.openapi.editor.ex.EditorSettingsExternalizable;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import gnu.trove.THashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.utils.StatisticsUtilKt.getBooleanUsage;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
class UiInfoUsageCollector extends UsagesCollector {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
Set<UsageDescriptor> set = new THashSet<>();
|
||||
|
||||
add(set, "Nav Bar visible", navbar() ? 1 : 0);
|
||||
add(set, "Nav Bar floating", navbar() ? 0 : 1);
|
||||
add(set, "Toolbar visible", toolbar() ? 1 : 0);
|
||||
add(set, "Toolbar hidden", toolbar() ? 0 : 1);
|
||||
add(set, "Toolbar + NavBar", !toolbar() && navbar() ? 1 : 0);
|
||||
add(set, "Toolbar and NavBar hidden", !toolbar() && !navbar() ? 1 : 0);
|
||||
add(set, "Status bar visible", status() ? 1 : 0);
|
||||
add(set, "Status bar hidden", status() ? 0 : 1);
|
||||
add(set, "Tool Window buttons visible", stripes() ? 1 : 0);
|
||||
add(set, "Tool Window buttons hidden", stripes() ? 0 : 1);
|
||||
add(set, "Recent Files = 15", recent() == 15 ? 1 : 0);
|
||||
add(set, "Recent Files (15, 30]", 15 < recent() && recent() < 31 ? 1 : 0);
|
||||
add(set, "Recent Files (30, 50]", 30 < recent() && recent() < 51 ? 1 : 0);
|
||||
add(set, "Recent Files > 50", 50 < recent() ? 1 : 0);
|
||||
add(set, "Block cursor", EditorSettingsExternalizable.getInstance().isBlockCursor() ? 1 : 0);
|
||||
add(set, "Line Numbers", EditorSettingsExternalizable.getInstance().isLineNumbersShown() ? 1 : 0);
|
||||
add(set, "Gutter Icons", EditorSettingsExternalizable.getInstance().areGutterIconsShown() ? 1 : 0);
|
||||
add(set, "Soft Wraps", EditorSettingsExternalizable.getInstance().isUseSoftWraps() ? 1 : 0);
|
||||
add(set, "Tabs None", tabPlace() == 0 ? 1 : 0);
|
||||
add(set, "Tabs Top", tabPlace() == SwingConstants.TOP ? 1 : 0);
|
||||
add(set, "Tabs Bottom", tabPlace() == SwingConstants.BOTTOM ? 1 : 0);
|
||||
add(set, "Tabs Left", tabPlace() == SwingConstants.LEFT ? 1 : 0);
|
||||
add(set, "Tabs Right", tabPlace() == SwingConstants.RIGHT ? 1 : 0);
|
||||
add(set, "Retina", UIUtil.isRetina() ? 1 : 0);
|
||||
add(set, "Show tips on startup", GeneralSettings.getInstance().isShowTipsOnStartup() ? 1 : 0);
|
||||
set.add(getBooleanUsage("Allow merging buttons", UISettings.getInstance().getAllowMergeButtons()));
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create("UI Features");
|
||||
}
|
||||
|
||||
private static void add(Set<UsageDescriptor> set, String key, int value) {
|
||||
set.add(new UsageDescriptor(key, value));
|
||||
}
|
||||
|
||||
private static int tabPlace() {
|
||||
return UISettings.getInstance().getEditorTabPlacement();
|
||||
}
|
||||
|
||||
private static int recent() {
|
||||
return UISettings.getInstance().getRecentFilesLimit();
|
||||
}
|
||||
|
||||
private static boolean stripes() {
|
||||
return UISettings.getInstance().getHideToolStripes();
|
||||
}
|
||||
|
||||
private static boolean status() {
|
||||
return UISettings.getInstance().getShowStatusBar();
|
||||
}
|
||||
|
||||
private static boolean toolbar() {
|
||||
return UISettings.getInstance().getShowMainToolbar();
|
||||
}
|
||||
|
||||
private static boolean navbar() {
|
||||
return UISettings.getInstance().getShowNavigationBar();
|
||||
}
|
||||
}
|
||||
+2
-9
@@ -2,6 +2,7 @@
|
||||
package com.intellij.internal.statistic.service.fus.beans;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -11,24 +12,16 @@ import java.util.Set;
|
||||
|
||||
public class FSGroup {
|
||||
|
||||
private static final String FORBIDDEN_PATTERN = "[,\\s\\n]+";
|
||||
private static final String FORBIDDEN_PATTERN_REPLACEMENT = "[??]";
|
||||
|
||||
public String id;
|
||||
public Map<String, Integer> metrics ;
|
||||
|
||||
private FSGroup(String id, Set<UsageDescriptor> usages) {
|
||||
this.id = id;
|
||||
for (UsageDescriptor usage : usages) {
|
||||
getMetrics().put(replaceForbiddenPattern(usage), usage.getValue());
|
||||
getMetrics().put(UsageDescriptorKeyValidator.replaceForbiddenSymbols(usage.getKey()), usage.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String replaceForbiddenPattern(@NotNull UsageDescriptor usage) {
|
||||
return usage.getKey().replaceAll(FORBIDDEN_PATTERN, FORBIDDEN_PATTERN_REPLACEMENT);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Map<String, Integer> getMetrics() {
|
||||
if (metrics == null) {
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistic.service.fus.collectors;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class UsageDescriptorKeyValidator {
|
||||
public static final String FORBIDDEN_PATTERN = "[,\\s\\n]+";
|
||||
public static final String FORBIDDEN_PATTERN_REPLACEMENT = "[??]";
|
||||
|
||||
@NotNull
|
||||
public static String replaceForbiddenSymbols(@NotNull String key) {
|
||||
return key.replaceAll(FORBIDDEN_PATTERN, FORBIDDEN_PATTERN_REPLACEMENT);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String ensureProperKey(@NotNull String key) {
|
||||
return key.replaceAll(FORBIDDEN_PATTERN, ".");
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ package com.intellij.openapi.actionSystem.impl;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.HelpTooltip;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ui.ToolbarClicksCollector;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ToolbarClicksCollector;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionButtonLook;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.PluginManager;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.idea.IdeaLogger;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.actions.ActionIdProvider;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.actions.ActionsCollectorImpl;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.ActionIdProvider;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.ActionsCollectorImpl;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ package com.intellij.openapi.actionSystem.impl;
|
||||
import com.intellij.featureStatistics.FeatureUsageTracker;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.ide.ui.laf.IconCache;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.actions.MainMenuCollector;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.MainMenuCollector;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.HelpTooltip;
|
||||
import com.intellij.ide.impl.DataManagerImpl;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ui.ToolbarClicksCollector;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ToolbarClicksCollector;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionButtonLook;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
package com.intellij.openapi.application;
|
||||
|
||||
import com.intellij.ide.cloudConfig.CloudConfigProvider;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigButtonUsages;
|
||||
import com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigButtonUsages;
|
||||
import com.intellij.openapi.MnemonicHelper;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.IdeEventQueue;
|
||||
import com.intellij.ide.ProhibitAWTEvents;
|
||||
import com.intellij.ide.impl.DataManagerImpl;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ui.ShortcutsCollector;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ShortcutsCollector;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.intellij.openapi.keymap.impl;
|
||||
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.IdeEventQueue;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ui.ShortcutsCollector;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ShortcutsCollector;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.ide.ui.UISettingsListener;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.ui.ToolbarClicksCollector;
|
||||
import com.intellij.internal.statistic.collectors.fus.ui.persistence.ToolbarClicksCollector;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.ui.plaf.beg;
|
||||
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.internal.statistic.customUsageCollectors.actions.MainMenuCollector;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.MainMenuCollector;
|
||||
import com.intellij.openapi.actionSystem.ActionPlaces;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.impl.ActionMenuItem;
|
||||
|
||||
@@ -906,11 +906,13 @@
|
||||
<copyPastePostProcessor implementation="com.intellij.codeInsight.editorActions.CopyPasteIndentProcessor"/>
|
||||
<copyPastePostProcessor implementation="com.intellij.codeInsight.editorActions.CopyPasteFoldingProcessor"/>
|
||||
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.fileTypes.LegacyFileTypeUsagesCollector"/>
|
||||
<statistics.projectUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.fileTypes.FileTypeUsagesCollector"/>
|
||||
|
||||
<statistics.usagesCollector implementation="com.intellij.facet.impl.statistics.FrameworkUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.facet.impl.statistics.ModuleTypeUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.execution.impl.statistics.RunConfigurationTypeUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.execution.impl.statistics.TemporaryRunConfigurationTypeUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.openapi.fileTypes.FileTypeUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.editor.LegacyEditorSettingsStatisticsCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.editor.LegacyEditorSettingsStatisticsCollector$ProjectUsages"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.editor.EditorSettingsStatisticsCollector"/>
|
||||
|
||||
@@ -202,12 +202,12 @@
|
||||
|
||||
<applicationService serviceImplementation="com.intellij.internal.statistic.UsageTrigger"/>
|
||||
<projectService serviceImplementation="com.intellij.internal.statistic.service.fus.collectors.FUSUsageTrigger"/>
|
||||
<applicationService serviceImplementation="com.intellij.internal.statistic.customUsageCollectors.ui.ToolbarClicksCollector"/>
|
||||
<applicationService serviceImplementation="com.intellij.internal.statistic.customUsageCollectors.ui.ShortcutsCollector"/>
|
||||
<applicationService serviceImplementation="com.intellij.internal.statistic.collectors.fus.ui.persistence.ToolbarClicksCollector"/>
|
||||
<applicationService serviceImplementation="com.intellij.internal.statistic.collectors.fus.ui.persistence.ShortcutsCollector"/>
|
||||
<applicationService serviceInterface="com.intellij.ide.actions.ActionsCollector"
|
||||
serviceImplementation="com.intellij.internal.statistic.customUsageCollectors.actions.ActionsCollectorImpl"/>
|
||||
<applicationService serviceImplementation="com.intellij.internal.statistic.customUsageCollectors.actions.MainMenuCollector"/>
|
||||
<applicationService serviceImplementation="com.intellij.internal.statistic.customUsageCollectors.actions.IntentionsCollector"/>
|
||||
serviceImplementation="com.intellij.internal.statistic.collectors.fus.actions.persistence.ActionsCollectorImpl"/>
|
||||
<applicationService serviceImplementation="com.intellij.internal.statistic.collectors.fus.actions.persistence.MainMenuCollector"/>
|
||||
<applicationService serviceImplementation="com.intellij.internal.statistic.collectors.fus.actions.persistence.IntentionsCollector"/>
|
||||
|
||||
<applicationService serviceImplementation="com.intellij.openapi.util.DimensionService"/>
|
||||
<applicationService serviceInterface="com.intellij.openapi.util.WindowStateService"
|
||||
@@ -387,42 +387,66 @@
|
||||
|
||||
<keymapExtension implementation="com.intellij.ide.actions.ToolWindowKeymapExtension"/>
|
||||
|
||||
<statistics.usagesCollector implementation="com.intellij.ide.plugins.DisabledPluginsUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.ide.plugins.NonBundledPluginsUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.featureStatistics.FeaturesUsageCollector"/>
|
||||
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.featureStatistics.fusCollectors.ProductivityUsageCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ProductivityUsageCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.plugins.DisabledPluginsUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.plugins.NonBundledPluginsUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ui.ToolbarClicksUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ui.EditorColorSchemesUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.actions.ActionUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.actions.IntentionUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.actions.MainMenuUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.jdk.JdkInfoUsageCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.os.OsNameUsageCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.os.OsVersionUsageCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ui.FontSizeInfoUsageCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ui.HiDPIModeUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ui.LaFUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ui.ScaleInfoUsageCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ui.ShortcutUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ui.UiInfoUsageCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.ui.A11YUsagesCollector"/>
|
||||
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.productivity.LegacyProductivityFeaturesUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.plugins.LegacyDisabledPluginsUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.plugins.LegacyNonBundledPluginsUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyToolbarClicksUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyEditorColorSchemesUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.actions.LegacyActionUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.actions.LegacyIntentionUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.actions.LegacyMainMenuUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.jdk.LegacyJdkInfoUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.os.LegacyOsNameUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.os.LegacyOsVersionUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyFontSizeInfoUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyHiDPIModeUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyLaFUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyScaleInfoUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyShortcutUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyUiInfoUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyUiInfoUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ui.LegacyA11YUsagesCollector"/>
|
||||
|
||||
<statistics.projectUsagesCollector implementation="com.intellij.openapi.vcs.statistics.VcsOptionsUsagesCollector"/>
|
||||
<statistics.projectUsagesCollector implementation="com.intellij.openapi.vcs.statistics.VcsStatsUsagesCollector"/>
|
||||
<statistics.projectUsagesCollector implementation="com.intellij.openapi.vcs.statistics.VcsNamesUsagesCollector"/>
|
||||
|
||||
<statistics.usagesCollector implementation="com.intellij.openapi.vcs.statistics.LegacyVcsOptionsUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.openapi.vcs.statistics.LegacyVcsStatsUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.openapi.vcs.statistics.LegacyVcsUsagesCollector"/>
|
||||
|
||||
<statistics.usagesCollector implementation="com.intellij.openapi.vcs.statistics.VcsUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.openapi.vcs.statistics.VcsOptionsUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.openapi.vcs.statistics.VcsStatsUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.UsageTrigger$MyCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ui.ToolbarClicksCollector$ToolbarClicksUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ui.ShortcutsCollector$ShortcutUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.actions.ActionsCollectorImpl$ActionUsagesCollector"/>
|
||||
<statistics.applicationUsagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.actions.ActionsCollectorImpl$ActionUsagesCollectorNew"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.actions.IntentionsCollector$IntentionUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ExperimentalFeaturesUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.RegistryUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.actions.MainMenuCollector$MainMenuUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ui.LaFUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.os.OsNameUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.os.OsVersionUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ui.UiInfoUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.jdk.JdkInfoUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.jdk.JdkSettingsUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ui.FontSizeInfoUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.build.BuildNumberUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ui.ScaleInfoUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ui.HiDPIModeUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ui.A11YUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigUsageCollectors$ConfigImport"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigUsageCollectors$SkipSteps"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigUsageCollectors$SelectedLAF"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigUsageCollectors$SelectedKeymap"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigUsageCollectors$DisabledPlugins"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.customUsageCollectors.ideSettings.IdeInitialConfigUsageCollectors$DownloadedPlugins"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.openapi.editor.colors.impl.EditorColorSchemesUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ExperimentalFeaturesUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.LegacyRegistryUsagesCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.jdk.JdkSettingsUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.build.BuildNumberUsageCollector"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigUsageCollectors$ConfigImport"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigUsageCollectors$SkipSteps"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigUsageCollectors$SelectedLAF"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigUsageCollectors$SelectedKeymap"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigUsageCollectors$DisabledPlugins"/>
|
||||
<statistics.usagesCollector implementation="com.intellij.internal.statistic.collectors.legacy.ideSettings.IdeInitialConfigUsageCollectors$DownloadedPlugins"/>
|
||||
|
||||
|
||||
<statistic.eventLog.featureUsageEventLogger implementation="com.intellij.internal.statistic.eventLog.FeatureUsageFileEventLogger"/>
|
||||
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@ package com.intellij.openapi.fileTypes;
|
||||
|
||||
import com.intellij.internal.statistic.CollectUsagesException;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.collectors.legacy.fileTypes.LegacyFileTypeUsagesCollector;
|
||||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
|
||||
import com.intellij.util.NotNullFunction;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -32,7 +33,7 @@ import java.util.Set;
|
||||
public class FileTypeUsagesCollectorTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
|
||||
private void doTest(@NotNull Collection<FileType> fileTypes) throws CollectUsagesException {
|
||||
final Set<UsageDescriptor> usages = new FileTypeUsagesCollector().getProjectUsages(getProject());
|
||||
final Set<UsageDescriptor> usages = new LegacyFileTypeUsagesCollector().getProjectUsages(getProject());
|
||||
for (UsageDescriptor usage : usages) {
|
||||
assertEquals(1, usage.getValue());
|
||||
}
|
||||
|
||||
@@ -15,11 +15,13 @@
|
||||
*/
|
||||
package com.intellij.openapi.vcs.checkout;
|
||||
|
||||
import com.intellij.internal.statistic.customUsageCollectors.actions.ActionIdProvider;
|
||||
import com.intellij.internal.statistic.collectors.fus.actions.persistence.ActionIdProvider;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.project.*;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.vcs.CheckoutProvider;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.vcs.statistics;
|
||||
|
||||
import com.intellij.internal.statistic.AbstractProjectsUsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyVcsOptionsUsagesCollector extends AbstractProjectsUsagesCollector {
|
||||
private static final String GROUP_ID = "vcs-options";
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
|
||||
return VcsOptionsUsagesCollector.getDescriptors(project);
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.vcs.statistics;
|
||||
|
||||
import com.intellij.internal.statistic.AbstractProjectsUsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyVcsStatsUsagesCollector extends AbstractProjectsUsagesCollector {
|
||||
private static final String GROUP_ID = "vcs-stats";
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
|
||||
return VcsStatsUsagesCollector.getDescriptors(project);
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,19 +13,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.ide.plugins;
|
||||
package com.intellij.openapi.vcs.statistics;
|
||||
|
||||
import com.intellij.internal.statistic.UsagesCollector;
|
||||
import com.intellij.internal.statistic.AbstractProjectsUsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class DisabledPluginsUsagesCollector extends UsagesCollector {
|
||||
private static final String GROUP_ID = "disabled-plugins";
|
||||
@Deprecated // to be removed in 2018.2
|
||||
public class LegacyVcsUsagesCollector extends AbstractProjectsUsagesCollector {
|
||||
private static final String GROUP_ID = "vcs";
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
@@ -33,7 +33,7 @@ public class DisabledPluginsUsagesCollector extends UsagesCollector {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages() {
|
||||
return ContainerUtil.map2Set(PluginManagerCore.getDisabledPlugins(), descriptor -> new UsageDescriptor(descriptor, 1));
|
||||
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
|
||||
return VcsNamesUsagesCollector.getDescriptors(project);
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.vcs.statistics;
|
||||
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.AbstractVcs;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class VcsNamesUsagesCollector extends ProjectUsagesCollector {
|
||||
|
||||
@NotNull
|
||||
public String getGroupId() {
|
||||
return "statistics.vcs.names";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getUsages(@NotNull Project project) {
|
||||
return getDescriptors(project);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Set<UsageDescriptor> getDescriptors(@NotNull Project project) {
|
||||
Set<UsageDescriptor> usages = new HashSet<>();
|
||||
|
||||
AbstractVcs[] activeVcss = ProjectLevelVcsManager.getInstance(project).getAllActiveVcss();
|
||||
List<String> vcsNames = ContainerUtil.map(activeVcss, AbstractVcs::getName);
|
||||
|
||||
for (String vcs : vcsNames) {
|
||||
usages.add(new UsageDescriptor(vcs, 1));
|
||||
}
|
||||
|
||||
if (vcsNames.size() > 1) {
|
||||
usages.add(new UsageDescriptor(StringUtil.join(ContainerUtil.sorted(vcsNames), ","), 1));
|
||||
}
|
||||
|
||||
return usages;
|
||||
}
|
||||
}
|
||||
+8
-22
@@ -1,23 +1,8 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.vcs.statistics;
|
||||
|
||||
import com.intellij.internal.statistic.AbstractProjectsUsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.VcsConfiguration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -28,16 +13,17 @@ import java.util.Set;
|
||||
import static com.intellij.internal.statistic.utils.StatisticsUtilKt.getBooleanUsage;
|
||||
import static com.intellij.internal.statistic.utils.StatisticsUtilKt.getEnumUsage;
|
||||
|
||||
public class VcsOptionsUsagesCollector extends AbstractProjectsUsagesCollector {
|
||||
private static final String GROUP_ID = "vcs-options";
|
||||
public class VcsOptionsUsagesCollector extends ProjectUsagesCollector {
|
||||
@NotNull
|
||||
public String getGroupId() { return "statistics.vcs.options"; }
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID);
|
||||
public Set<UsageDescriptor> getUsages(@NotNull Project project) {
|
||||
return getDescriptors(project);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
|
||||
public static Set<UsageDescriptor> getDescriptors(@NotNull Project project) {
|
||||
VcsConfiguration configuration = VcsConfiguration.getInstance(project);
|
||||
Set<UsageDescriptor> usages = new HashSet<>();
|
||||
|
||||
|
||||
+12
-10
@@ -1,30 +1,32 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.vcs.statistics;
|
||||
|
||||
import com.intellij.internal.statistic.AbstractProjectsUsagesCollector;
|
||||
import com.intellij.internal.statistic.beans.GroupDescriptor;
|
||||
import com.intellij.internal.statistic.beans.UsageDescriptor;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
|
||||
import com.intellij.openapi.vcs.ex.ProjectLevelVcsManagerEx;
|
||||
import java.util.HashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.internal.statistic.utils.StatisticsUtilKt.getBooleanUsage;
|
||||
import static com.intellij.internal.statistic.utils.StatisticsUtilKt.getCountingUsage;
|
||||
|
||||
public class VcsStatsUsagesCollector extends AbstractProjectsUsagesCollector {
|
||||
private static final String GROUP_ID = "vcs-stats";
|
||||
|
||||
public class VcsStatsUsagesCollector extends ProjectUsagesCollector {
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID);
|
||||
public String getGroupId() {
|
||||
return "statistics.vcs.metrics";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
|
||||
public Set<UsageDescriptor> getUsages(@NotNull Project project) {
|
||||
return getDescriptors(project);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Set<UsageDescriptor> getDescriptors(@NotNull Project project) {
|
||||
Set<UsageDescriptor> usages = new HashSet<>();
|
||||
|
||||
ChangeListManagerImpl clm = ChangeListManagerImpl.getInstanceImpl(project);
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.vcs.statistics;
|
||||
|
||||
import com.intellij.internal.statistic.AbstractProjectsUsagesCollector;
|
||||
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.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.AbstractVcs;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class VcsUsagesCollector extends AbstractProjectsUsagesCollector {
|
||||
private static final String GROUP_ID = "vcs";
|
||||
|
||||
@NotNull
|
||||
public GroupDescriptor getGroupId() {
|
||||
return GroupDescriptor.create(GROUP_ID, GroupDescriptor.HIGHER_PRIORITY);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
|
||||
Set<UsageDescriptor> usages = new HashSet<>();
|
||||
|
||||
AbstractVcs[] activeVcss = ProjectLevelVcsManager.getInstance(project).getAllActiveVcss();
|
||||
List<String> vcsNames = ContainerUtil.map(activeVcss, AbstractVcs::getName);
|
||||
|
||||
for (String vcs : vcsNames) {
|
||||
usages.add(new UsageDescriptor(vcs, 1));
|
||||
}
|
||||
|
||||
if (vcsNames.size() > 1) {
|
||||
usages.add(new UsageDescriptor(StringUtil.join(ContainerUtil.sorted(vcsNames), ","), 1));
|
||||
}
|
||||
|
||||
return usages;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user