use of com.intellij.project.model.impl.module.JpsRootModel in project intellij-community by JetBrains.
the class MavenSourceFoldersModuleExtension method init.
public void init(@NotNull Module module, @NotNull ModifiableRootModel modifiableRootModel) {
myRootModel = modifiableRootModel;
myDummyJpsModule = JpsElementFactory.getInstance().createModule(module.getName(), JpsJavaModuleType.INSTANCE, JpsElementFactory.getInstance().createDummyElement());
myDummyJpsRootModel = new JpsRootModel(module, myDummyJpsModule);
for (JpsSourceFolder folder : myJpsSourceFolders) {
Disposer.dispose(folder);
}
myJpsSourceFolders.clear();
for (ContentEntry eachEntry : modifiableRootModel.getContentEntries()) {
for (SourceFolder eachFolder : eachEntry.getSourceFolders()) {
//noinspection unchecked
final JpsModuleSourceRoot jpsModuleSourceRoot = JpsElementFactory.getInstance().createModuleSourceRoot(eachFolder.getUrl(), (JpsModuleSourceRootType<JpsElement>) eachFolder.getRootType(), eachFolder.getJpsElement().getProperties().getBulkModificationSupport().createCopy());
addJspSourceFolder(jpsModuleSourceRoot, eachFolder.getUrl());
}
}
}
Aggregations