Java Code Examples for com.intellij.openapi.roots.ui.configuration.ModulesProvider#getModules()
The following examples show how to use
com.intellij.openapi.roots.ui.configuration.ModulesProvider#getModules() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HaxeProjectConfigurationUpdater.java From intellij-haxe with Apache License 2.0 | 6 votes |
private void setupLibraries(Project project, ModifiableModelsProvider modelsProvider, ModulesProvider modulesProvider, List<LibraryData> libraries) { LibraryTable.ModifiableModel librariesModel = modelsProvider.getLibraryTableModifiableModel(project); for(LibraryData lib:libraries) { VirtualFile root = LocalFileSystem.getInstance().findFileByPath(lib.getClasspath()); if(root != null) { LibraryImpl library = (LibraryImpl)librariesModel.createLibrary(lib.getName()); LibraryEx.ModifiableModelEx model = library.getModifiableModel(); model.setKind(HaxeLibraryType.HAXE_LIBRARY); model.addRoot(root, OrderRootType.CLASSES); model.addRoot(root, OrderRootType.SOURCES); model.commit(); for(Module module:modulesProvider.getModules()) { ModifiableRootModel moduleModel = modelsProvider.getModuleModifiableModel(module); moduleModel.addLibraryEntry(library); moduleModel.commit(); } } } librariesModel.commit(); }
Example 2
Source File: HaxeProjectConfigurationUpdater.java From intellij-haxe with Apache License 2.0 | 5 votes |
@Nullable private Module getRootModule(ModifiableModelsProvider modelsProvider, ModulesProvider modulesProvider) { for(Module module:modulesProvider.getModules()) { ModifiableRootModel model = modelsProvider.getModuleModifiableModel(module); for(VirtualFile root:model.getContentRoots()) { if(root.getPath().equals(myProjectRoot)) { return module; } } } return null; }
Example 3
Source File: ModuleOutputElementTypeBase.java From consulo with Apache License 2.0 | 5 votes |
private List<Module> getSuitableModules(ArtifactEditorContext context) { ModulesProvider modulesProvider = context.getModulesProvider(); ArrayList<Module> modules = new ArrayList<Module>(); for (Module module : modulesProvider.getModules()) { if (isSuitableModule(modulesProvider, module)) { modules.add(module); } } return modules; }
Example 4
Source File: ModuleUtil.java From consulo with Apache License 2.0 | 5 votes |
public static boolean hasModuleExtension(@Nonnull ModulesProvider modulesProvider, @Nonnull Class<? extends ModuleExtension> clazz) { for (Module module : modulesProvider.getModules()) { ModuleRootModel rootModel = modulesProvider.getRootModel(module); if (rootModel == null) { continue; } ModuleExtension extension = rootModel.getExtension(clazz); if (extension != null) { return true; } } return false; }