use of com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider in project intellij-community by JetBrains.
the class ModuleCompilerUtil method getCyclicDependencies.
@NotNull
public static List<Chunk<ModuleSourceSet>> getCyclicDependencies(@NotNull Project project, @NotNull List<Module> modules) {
Collection<Chunk<ModuleSourceSet>> chunks = computeSourceSetCycles(new DefaultModulesProvider(project));
final Set<Module> modulesSet = new HashSet<>(modules);
return ContainerUtil.filter(chunks, chunk -> {
for (ModuleSourceSet sourceSet : chunk.getNodes()) {
if (modulesSet.contains(sourceSet.getModule())) {
return true;
}
}
return false;
});
}
use of com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider in project intellij-community by JetBrains.
the class ModuleOutputPackagingElementBase method findModule.
@Override
@Nullable
public Module findModule(PackagingElementResolvingContext context) {
if (myModulePointer != null) {
final Module module = myModulePointer.getModule();
final ModulesProvider modulesProvider = context.getModulesProvider();
if (module != null) {
if (//optimization
modulesProvider instanceof DefaultModulesProvider || ArrayUtil.contains(module, modulesProvider.getModules())) {
return module;
}
}
return modulesProvider.getModule(myModulePointer.getModuleName());
}
return null;
}
use of com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider in project intellij-community by JetBrains.
the class NewModuleAction method createModuleFromWizard.
@Nullable
public Module createModuleFromWizard(Project project, @Nullable Object dataFromContext, AbstractProjectWizard wizard) {
final ProjectBuilder builder = wizard.getProjectBuilder();
if (builder instanceof ModuleBuilder) {
final ModuleBuilder moduleBuilder = (ModuleBuilder) builder;
if (moduleBuilder.getName() == null) {
moduleBuilder.setName(wizard.getProjectName());
}
if (moduleBuilder.getModuleFilePath() == null) {
moduleBuilder.setModuleFilePath(wizard.getModuleFilePath());
}
}
if (!builder.validate(project, project)) {
return null;
}
Module module;
if (builder instanceof ModuleBuilder) {
module = ((ModuleBuilder) builder).commitModule(project, null);
if (module != null) {
processCreatedModule(module, dataFromContext);
}
return module;
} else {
List<Module> modules = builder.commit(project, null, new DefaultModulesProvider(project));
if (builder.isOpenProjectSettingsAfter()) {
ModulesConfigurator.showDialog(project, null, null);
}
module = modules == null || modules.isEmpty() ? null : modules.get(0);
}
project.save();
return module;
}
use of com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider in project intellij-community by JetBrains.
the class FrameworkDetectionManager method showSetupFrameworksDialog.
private void showSetupFrameworksDialog(Notification notification) {
List<? extends DetectedFrameworkDescription> descriptions;
try {
descriptions = getValidDetectedFrameworks();
} catch (IndexNotReadyException e) {
DumbService.getInstance(myProject).showDumbModeNotification("Information about detected frameworks is not available until indices are built");
return;
}
if (descriptions.isEmpty()) {
Messages.showInfoMessage(myProject, "No frameworks are detected", "Framework Detection");
return;
}
final ConfigureDetectedFrameworksDialog dialog = new ConfigureDetectedFrameworksDialog(myProject, descriptions);
if (dialog.showAndGet()) {
notification.expire();
List<DetectedFrameworkDescription> selected = dialog.getSelectedFrameworks();
FrameworkDetectionUtil.setupFrameworks(selected, new PlatformModifiableModelsProvider(), new DefaultModulesProvider(myProject));
for (DetectedFrameworkDescription description : selected) {
final int detectorId = FrameworkDetectorRegistry.getInstance().getDetectorId(description.getDetector());
myDetectedFrameworksData.putExistentFrameworkFiles(detectorId, description.getRelatedFiles());
}
}
}
use of com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider in project liferay-ide by liferay.
the class NewLiferayModuleAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent event) {
Project project = getEventProject(event);
if (!_isValidWorkspaceLocation(project)) {
Messages.showErrorDialog("Unable to detect current project as a Liferay workspace", "No Liferay workspace");
return;
}
String defaultPath = null;
VirtualFile virtualFile = event.getData(CommonDataKeys.VIRTUAL_FILE);
if ((virtualFile != null) && virtualFile.isDirectory()) {
defaultPath = virtualFile.getPath();
}
NewLiferayModuleWizard wizard = new NewLiferayModuleWizard(project, new DefaultModulesProvider(project), defaultPath);
if (wizard.showAndGet()) {
createModuleFromWizard(project, wizard);
}
}
Aggregations