use of com.intellij.openapi.roots.ModuleOrderEntry in project intellij-community by JetBrains.
the class PyModuleDependenciesConfigurable method apply.
@Override
public void apply() throws ConfigurationException {
ApplicationManager.getApplication().runWriteAction(() -> {
ModifiableRootModel model = ModuleRootManager.getInstance(myModule).getModifiableModel();
List<ModuleOrderEntry> entries = new ArrayList<>();
for (OrderEntry entry : model.getOrderEntries()) {
if (entry instanceof ModuleOrderEntry) {
entries.add((ModuleOrderEntry) entry);
}
}
for (ModuleOrderEntry entry : entries) {
model.removeOrderEntry(entry);
}
for (Module module : collectDependencies()) {
model.addModuleOrderEntry(module);
}
model.commit();
});
}
Aggregations