Set<MetricEvent> (final @NotNull Project project) { final ProjectView projectView = project.getServiceIfCreated(ProjectView.class); if (projectView == null) { return Collections.emptySet(); } final AbstractProjectViewPane currentViewPane = projectView.getCurrentProjectViewPane(); if (currentViewPane == null) { return Collections.emptySet(); } final List<EventPair<?>> data = new ArrayList<>(); data.add(CLASS_NAME.with(currentViewPane.getClass())); final NamedScope selectedScope = currentViewPane instanceof ScopeViewPane ? ((ScopeViewPane)currentViewPane).getSelectedScope() : null; if (selectedScope != null) { data.add(SCOPE_CLASS_NAME.with(selectedScope.getClass())); } return Collections.singleton(CURRENT.metric(data)); }