public void configure()

in src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultSearchScopeConfigurator.java [49:113]


    public void configure(
        final @NotNull ProgressIndicator indicator,
        final @NotNull Project project,
        final @NotNull ApplicationSettings applicationSettings,
        final @NotNull ModifiableModuleModel model
    ) {
        indicator.setText(message("hybris.project.import.search.scope"));
        final String customGroupName = applicationSettings.getGroupCustom();
        final String commerceGroupName = applicationSettings.getGroupHybris();
        final String nonHybrisGroupName = applicationSettings.getGroupNonHybris();
        final String platformGroupName = applicationSettings.getGroupPlatform();
        final List<NamedScope> newScopes = new ArrayList<>();
        NamedScope customScope = null;
        NamedScope platformScope = null;
        NamedScope commerceScope = null;
        NamedScope hybrisScope = null;

        if (groupExists(model, customGroupName)) {
            customScope = createScope(HybrisIcons.Extension.INSTANCE.getCUSTOM(), customGroupName);
            newScopes.add(customScope);

            newScopes.add(new NamedScope(
                HybrisI18NBundleUtils.message("hybris.scope.editable.custom.ts.files"),
                new FilePatternPackageSet(
                    customGroupName + '*',
                    "*//*" + HYBRIS_ITEMS_XML_FILE_ENDING
                )
            ));

            newScopes.add(new NamedScope(
                SEARCH_SCOPE_Y_PREFIX + ' ' + HybrisI18NBundleUtils.message("hybris.scope.editable.custom.ts.beans.impex.files"),
                createCustomTsImpexBeansFilesPattern(applicationSettings)
            ));
        }
        if (groupExists(model, platformGroupName)) {
            platformScope = createScope(HybrisIcons.Scope.INSTANCE.getPLATFORM_GROUP(), platformGroupName);
            newScopes.add(platformScope);
        }
        if (groupExists(model, commerceGroupName)) {
            commerceScope = createScope(HybrisIcons.Scope.INSTANCE.getCOMMERCE_GROUP(), commerceGroupName);
            newScopes.add(commerceScope);
        }
        if (platformScope != null && commerceScope != null) {
            hybrisScope = createScopeFor2Groups(HybrisIcons.Scope.INSTANCE.getPLATFORM(), platformGroupName, commerceGroupName);
            newScopes.add(hybrisScope);
        }
        if (groupExists(model, nonHybrisGroupName)) {
            newScopes.add(createScope(HybrisIcons.Scope.INSTANCE.getLOCAL(), nonHybrisGroupName));
        }
        newScopes.add(new NamedScope(
            HybrisI18NBundleUtils.message("hybris.scope.editable.all.ts.files"),
            new FilePatternPackageSet(null, "*//*" + HYBRIS_ITEMS_XML_FILE_ENDING)
        ));
        newScopes.add(new NamedScope(
            HybrisI18NBundleUtils.message("hybris.scope.editable.all.beans.files"),
            new FilePatternPackageSet(null, "*//*" + HYBRIS_BEANS_XML_FILE_ENDING)
        ));
        ApplicationManager.getApplication().invokeLater(() -> addOrReplaceScopes(project, newScopes));

        final NamedScope defaultScope = customScope != null ? customScope : hybrisScope != null ? hybrisScope : platformScope;
        if (defaultScope != null) {
            FindSettings.getInstance().setCustomScope(defaultScope.getPresentableName());
            FindSettings.getInstance().setDefaultScopeName(defaultScope.getPresentableName());
        }
    }