use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-community by JetBrains.
the class ProjectStructureValidator method showDialogAndAddLibraryToDependencies.
public static void showDialogAndAddLibraryToDependencies(final Library library, final Project project, boolean allowEmptySelection) {
for (ProjectStructureValidator validator : EP_NAME.getExtensions()) {
if (validator.addLibraryToDependencies(library, project, allowEmptySelection)) {
return;
}
}
final ModuleStructureConfigurable moduleStructureConfigurable = ModuleStructureConfigurable.getInstance(project);
final List<Module> modules = LibraryEditingUtil.getSuitableModules(moduleStructureConfigurable, ((LibraryEx) library).getKind(), library);
if (modules.isEmpty())
return;
final ChooseModulesDialog dlg = new ChooseModulesDialog(moduleStructureConfigurable.getProject(), modules, ProjectBundle.message("choose.modules.dialog.title"), ProjectBundle.message("choose.modules.dialog.description", library.getName()));
if (dlg.showAndGet()) {
final List<Module> chosenModules = dlg.getChosenElements();
for (Module module : chosenModules) {
moduleStructureConfigurable.addLibraryOrderEntry(module, library);
}
}
}
use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-plugins by JetBrains.
the class FlexBCConfigurator method createConfigurableNode.
private void createConfigurableNode(ModifiableFlexBuildConfiguration bc, Module module, Runnable treeNodeNameUpdater) {
CompositeConfigurable wrapped = createBcConfigurable(module, bc, treeNodeNameUpdater);
myConfigurablesMap.put(bc, wrapped);
final MasterDetailsComponent.MyNode node = new BuildConfigurationNode(wrapped);
final ModuleStructureConfigurable moduleStructureConfigurable = ModuleStructureConfigurable.getInstance(module.getProject());
moduleStructureConfigurable.addNode(node, moduleStructureConfigurable.findModuleNode(module));
Place place = new Place().putPath(ProjectStructureConfigurable.CATEGORY, moduleStructureConfigurable).putPath(MasterDetailsComponent.TREE_OBJECT, bc);
ProjectStructureConfigurable.getInstance(module.getProject()).navigateTo(place, true);
}
use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-plugins by JetBrains.
the class FlexBCConfigurator method reset.
public void reset(Project project) {
myModifiableModelInitializer.ensureInitialized(project);
ModuleStructureConfigurable moduleStructureConfigurable = ModuleStructureConfigurable.getInstance(project);
for (final CompositeConfigurable configurable : myConfigurablesMap.values()) {
moduleStructureConfigurable.ensureInitialized(configurable);
}
}
use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-community by JetBrains.
the class CreateNewLibraryAction method createActionOrGroup.
public static AnAction[] createActionOrGroup(@NotNull String text, @NotNull BaseLibrariesConfigurable librariesConfigurable, @NotNull final Project project) {
final LibraryType<?>[] extensions = LibraryType.EP_NAME.getExtensions();
List<LibraryType<?>> suitableTypes = new ArrayList<>();
if (librariesConfigurable instanceof ProjectLibrariesConfigurable || !project.isDefault()) {
final ModuleStructureConfigurable configurable = ModuleStructureConfigurable.getInstance(project);
for (LibraryType<?> extension : extensions) {
if (!LibraryEditingUtil.getSuitableModules(configurable, extension.getKind(), null).isEmpty()) {
suitableTypes.add(extension);
}
}
} else {
Collections.addAll(suitableTypes, extensions);
}
if (suitableTypes.isEmpty()) {
return new AnAction[] { new CreateNewLibraryAction(text, PlatformIcons.LIBRARY_ICON, null, librariesConfigurable, project) };
}
List<AnAction> actions = new ArrayList<>();
actions.add(new CreateNewLibraryAction(IdeBundle.message("create.default.library.type.action.name"), PlatformIcons.LIBRARY_ICON, null, librariesConfigurable, project));
for (LibraryType<?> type : suitableTypes) {
final String actionName = type.getCreateActionName();
if (actionName != null) {
actions.add(new CreateNewLibraryAction(actionName, type.getIcon(null), type, librariesConfigurable, project));
}
}
return actions.toArray(new AnAction[actions.size()]);
}
use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-community by JetBrains.
the class ProjectJdkConfigurable method clearCaches.
private void clearCaches() {
final ModuleStructureConfigurable rootConfigurable = ModuleStructureConfigurable.getInstance(myProject);
Module[] modules = rootConfigurable.getModules();
for (Module module : modules) {
final StructureConfigurableContext context = rootConfigurable.getContext();
context.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(context, module));
}
}
Aggregations