List<ProjectStructureElementUsage> () { List<ProjectStructureElementUsage> usages = new ArrayList<>(); Collection<UnloadedModuleDescription> unloadedModules = ModuleManager.getInstance(myContext.getProject()).getUnloadedModuleDescriptions(); if (!unloadedModules.isEmpty()) { MultiMap<Module, UnloadedModuleDescription> dependenciesInUnloadedModules = new MultiMap<>(); for (UnloadedModuleDescription unloaded : unloadedModules) { for (String moduleName : unloaded.getDependencyModuleNames()) { Module depModule = myContext.getModulesConfigurator().getModuleModel().findModuleByName(moduleName); if (depModule != null) { dependenciesInUnloadedModules.putValue(depModule, unloaded); } } } for (Map.Entry<Module, Collection<UnloadedModuleDescription>> entry : dependenciesInUnloadedModules.entrySet()) { usages.add(new UsagesInUnloadedModules(myContext, this, new ModuleProjectStructureElement(myContext, entry.getKey()), entry.getValue())); } //currently we don't store dependencies on project libraries from unloaded modules in the model, so suppose that all the project libraries are used for (Library library : myContext.getProjectLibrariesProvider().getModifiableModel().getLibraries()) { usages.add(new UsagesInUnloadedModules(myContext, this, new LibraryProjectStructureElement(myContext, library), unloadedModules)); } } for (String libraryName : BuildProcessCustomPluginsConfiguration.getInstance(myContext.getProject()).getProjectLibraries()) { Library library = myContext.getProjectLibrariesProvider().getModifiableModel().getLibraryByName(libraryName); if (library != null) { usages.add(new UsageInProjectSettings(myContext, new LibraryProjectStructureElement(myContext, library), JavaUiBundle.message("label.build.process.configuration"))); } } return usages; }