use of com.intellij.internal.statistic.beans.UsageDescriptor in project intellij-community by JetBrains.
the class LibraryUsageCollector method getProjectUsages.
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
final Set<LibraryKind> usedKinds = new HashSet<>();
final Processor<Library> processor = library -> {
usedKinds.addAll(LibraryPresentationManagerImpl.getLibraryKinds(library, null));
return true;
};
for (Module module : ModuleManager.getInstance(project).getModules()) {
ModuleRootManager.getInstance(module).orderEntries().librariesOnly().forEachLibrary(processor);
}
final HashSet<UsageDescriptor> usageDescriptors = new HashSet<>();
for (LibraryKind kind : usedKinds) {
usageDescriptors.add(new UsageDescriptor(kind.getKindId(), 1));
}
return usageDescriptors;
}
use of com.intellij.internal.statistic.beans.UsageDescriptor in project intellij-community by JetBrains.
the class EditorSettingsStatisticsCollector method getUsages.
@NotNull
@Override
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
Set<UsageDescriptor> set = new HashSet<>();
EditorSettingsExternalizable es = EditorSettingsExternalizable.getInstance();
addIfDiffers(set, es.isVirtualSpace(), false, "caretAfterLineEnd");
addIfDiffers(set, es.isCaretInsideTabs(), false, "caretInsideTabs");
addIfDiffers(set, es.isAdditionalPageAtBottom(), false, "virtualSpaceAtFileBottom");
addIfDiffers(set, es.isUseSoftWraps(SoftWrapAppliancePlaces.MAIN_EDITOR), false, "softWraps");
addIfDiffers(set, es.isUseSoftWraps(SoftWrapAppliancePlaces.CONSOLE), false, "softWraps.console");
addIfDiffers(set, es.isUseSoftWraps(SoftWrapAppliancePlaces.PREVIEW), false, "softWraps.preview");
addIfDiffers(set, es.isUseCustomSoftWrapIndent(), false, "softWraps.relativeIndent");
addIfDiffers(set, es.isAllSoftWrapsShown(), false, "softWraps.showAll");
addIfDiffers(set, es.getStripTrailingSpaces(), EditorSettingsExternalizable.STRIP_TRAILING_SPACES_CHANGED, "stripTrailingSpaces");
addIfDiffers(set, es.isEnsureNewLineAtEOF(), false, "ensureNewlineAtEOF");
addIfDiffers(set, es.isShowQuickDocOnMouseOverElement(), false, "quickDocOnMouseHover");
addIfDiffers(set, es.isBlinkCaret(), true, "blinkingCaret");
addIfDiffers(set, es.isBlockCursor(), false, "blockCaret");
addIfDiffers(set, es.isRightMarginShown(), true, "rightMargin");
addIfDiffers(set, es.isLineNumbersShown(), true, "lineNumbers");
addIfDiffers(set, es.areGutterIconsShown(), true, "gutterIcons");
addIfDiffers(set, es.isFoldingOutlineShown(), true, "foldingOutline");
addIfDiffers(set, es.isWhitespacesShown() && es.isLeadingWhitespacesShown(), false, "showLeadingWhitespace");
addIfDiffers(set, es.isWhitespacesShown() && es.isInnerWhitespacesShown(), false, "showInnerWhitespace");
addIfDiffers(set, es.isWhitespacesShown() && es.isTrailingWhitespacesShown(), false, "showTrailingWhitespace");
addIfDiffers(set, es.isIndentGuidesShown(), true, "indentGuides");
addIfDiffers(set, es.isSmoothScrolling(), true, "animatedScroll");
addIfDiffers(set, es.isDndEnabled(), true, "dragNDrop");
addIfDiffers(set, es.isWheelFontChangeEnabled(), false, "wheelZoom");
addIfDiffers(set, es.isMouseClickSelectionHonorsCamelWords(), true, "mouseCamel");
addIfDiffers(set, es.isVariableInplaceRenameEnabled(), true, "inplaceRename");
addIfDiffers(set, es.isPreselectRename(), true, "preselectOnRename");
addIfDiffers(set, es.isShowInlineLocalDialog(), true, "inlineDialog");
addIfDiffers(set, es.isRefrainFromScrolling(), false, "minimizeScrolling");
addIfDiffers(set, es.getOptions().SHOW_NOTIFICATION_AFTER_REFORMAT_CODE_ACTION, true, "afterReformatNotification");
addIfDiffers(set, es.getOptions().SHOW_NOTIFICATION_AFTER_OPTIMIZE_IMPORTS_ACTION, true, "afterOptimizeNotification");
addIfDiffers(set, es.isSmartHome(), true, "smartHome");
addIfDiffers(set, es.isCamelWords(), false, "camelWords");
addIfDiffers(set, es.isShowParameterNameHints(), true, "editor.inlay.parameter.hints");
RichCopySettings rcs = RichCopySettings.getInstance();
addIfDiffers(set, rcs.isEnabled(), true, "richCopy");
CodeInsightSettings cis = CodeInsightSettings.getInstance();
addIfDiffers(set, cis.AUTO_POPUP_PARAMETER_INFO, true, "parameterAutoPopup");
addIfDiffers(set, cis.AUTO_POPUP_JAVADOC_INFO, false, "javadocAutoPopup");
addIfDiffers(set, cis.AUTO_POPUP_COMPLETION_LOOKUP, true, "completionAutoPopup");
addIfDiffers(set, cis.COMPLETION_CASE_SENSITIVE, CodeInsightSettings.FIRST_LETTER, "completionCaseSensitivity");
addIfDiffers(set, cis.SELECT_AUTOPOPUP_SUGGESTIONS_BY_CHARS, false, "autoPopupCharComplete");
addIfDiffers(set, cis.AUTOCOMPLETE_ON_CODE_COMPLETION, true, "autoCompleteBasic");
addIfDiffers(set, cis.AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION, true, "autoCompleteSmart");
addIfDiffers(set, cis.SHOW_FULL_SIGNATURES_IN_PARAMETER_INFO, false, "parameterInfoFullSignature");
addIfDiffers(set, cis.getBackspaceMode(), SmartBackspaceMode.AUTOINDENT, "smartBackspace");
addIfDiffers(set, cis.SMART_INDENT_ON_ENTER, true, "indentOnEnter");
addIfDiffers(set, cis.INSERT_BRACE_ON_ENTER, true, "braceOnEnter");
addIfDiffers(set, cis.JAVADOC_STUB_ON_ENTER, true, "javadocOnEnter");
addIfDiffers(set, cis.SMART_END_ACTION, true, "smartEnd");
addIfDiffers(set, cis.JAVADOC_GENERATE_CLOSING_TAG, true, "autoCloseJavadocTags");
addIfDiffers(set, cis.SURROUND_SELECTION_ON_QUOTE_TYPED, false, "surroundByQuoteOrBrace");
addIfDiffers(set, cis.AUTOINSERT_PAIR_BRACKET, true, "pairBracketAutoInsert");
addIfDiffers(set, cis.AUTOINSERT_PAIR_QUOTE, true, "pairQuoteAutoInsert");
addIfDiffers(set, cis.REFORMAT_BLOCK_ON_RBRACE, true, "reformatOnRBrace");
addIfDiffers(set, cis.REFORMAT_ON_PASTE, CodeInsightSettings.INDENT_EACH_LINE, "reformatOnPaste");
addIfDiffers(set, cis.ADD_IMPORTS_ON_PASTE, CodeInsightSettings.ASK, "importsOnPaste");
addIfDiffers(set, cis.HIGHLIGHT_BRACES, true, "bracesHighlight");
addIfDiffers(set, cis.HIGHLIGHT_SCOPE, false, "scopeHighlight");
addIfDiffers(set, cis.HIGHLIGHT_IDENTIFIER_UNDER_CARET, true, "identifierUnderCaretHighlight");
addIfDiffers(set, cis.ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY, false, "autoAddImports");
return set;
}
use of com.intellij.internal.statistic.beans.UsageDescriptor in project intellij-community by JetBrains.
the class BackgroundImagesUsageCollector method getProjectUsages.
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
boolean editor = StringUtil.isNotEmpty(getBackgroundSpec(project, EDITOR_PROP));
boolean frame = StringUtil.isNotEmpty(getBackgroundSpec(project, FRAME_PROP));
return ContainerUtil.newHashSet(new UsageDescriptor("editor", editor ? 1 : 0), new UsageDescriptor("frame", frame ? 1 : 0));
}
use of com.intellij.internal.statistic.beans.UsageDescriptor in project intellij-community by JetBrains.
the class EditorColorSchemesUsagesCollector method getUsages.
@NotNull
@Override
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
EditorColorsScheme currentScheme = EditorColorsManager.getInstance().getGlobalScheme();
Set<UsageDescriptor> usages = ContainerUtil.newHashSet();
String schemeName = SCHEME_NAME_OTHER;
if (currentScheme instanceof AbstractColorsScheme) {
String name = currentScheme.getName();
if (name.startsWith(SchemeManager.EDITABLE_COPY_PREFIX)) {
EditorColorsScheme original = ((AbstractColorsScheme) currentScheme).getOriginal();
if (original != null) {
schemeName = original.getName();
}
}
usages.add(new UsageDescriptor(schemeName, 1));
}
return usages;
}
use of com.intellij.internal.statistic.beans.UsageDescriptor in project intellij-community by JetBrains.
the class ApplicationStatisticsPersistenceComponent method loadState.
@Override
public void loadState(Element element) {
for (Element groupElement : element.getChildren(GROUP_TAG)) {
GroupDescriptor groupDescriptor = GroupDescriptor.create(groupElement.getAttributeValue(GROUP_NAME_ATTR));
List<Element> projectsList = groupElement.getChildren(PROJECT_TAG);
for (Element projectElement : projectsList) {
String projectId = projectElement.getAttributeValue(PROJECT_ID_ATTR);
String frameworks = projectElement.getAttributeValue(VALUES_ATTR);
if (!StringUtil.isEmptyOrSpaces(projectId) && !StringUtil.isEmptyOrSpaces(frameworks)) {
Set<UsageDescriptor> frameworkDescriptors = new THashSet<>();
for (String key : StringUtil.split(frameworks, TOKENIZER)) {
UsageDescriptor descriptor = getUsageDescriptor(key);
if (descriptor != null) {
frameworkDescriptors.add(descriptor);
}
}
long collectionTime;
try {
collectionTime = Long.valueOf(projectElement.getAttributeValue(COLLECTION_TIME_TAG));
} catch (NumberFormatException ignored) {
collectionTime = 0;
}
getApplicationData(groupDescriptor).put(projectId, new CollectedUsages(frameworkDescriptors, collectionTime));
}
}
}
}
Aggregations