void (final SelectInContext context, final boolean requestFocus) { ProjectView projectView = ProjectView.getInstance(context.getProject()); Collection<SelectInTarget> targets = projectView.getSelectInTargets(); Collection<SelectInTarget> targetsToCheck = new LinkedHashSet<>(); String currentId = projectView.getCurrentViewId(); for (SelectInTarget projectViewTarget : targets) { if (Objects.equals(currentId, projectViewTarget.getMinorViewId())) { targetsToCheck.add(projectViewTarget); break; } } targetsToCheck.addAll(targets); context.getProject().getService(SelectInProjectViewImpl.class).selectInAnyTarget(context, targetsToCheck, requestFocus); }