ScopeChooserGroup ( @NotNull Project project, @NotNull Disposable parentDisposable, @NotNull UsageViewImpl usageView, @NotNull ShowUsagesPopupData showUsagesPopupData ) { ShowUsagesActionHandler actionHandler = showUsagesPopupData.actionHandler; ScopeChooserGroup result = new ScopeChooserGroup(project, parentDisposable, actionHandler.getSelectedScope()); result.addChangeListener(scope -> { UsageViewStatisticsCollector.logScopeChanged(project, usageView, actionHandler.getSelectedScope(), scope, actionHandler.getTargetClass()); cancel(showUsagesPopupData.popupRef.get(), actionHandler, CLOSE_REASON_CHANGE_SCOPE); ShowUsagesActionHandler handler = actionHandler.withScope(scope); if (handler != null) { showElementUsages(showUsagesPopupData.parameters, handler); } }); return result; }