Search in sources :

Example 1 with ModulePointerManager

use of com.intellij.openapi.module.ModulePointerManager in project intellij-community by JetBrains.

the class ModuleOutputElementTypeBase method chooseAndCreate.

@NotNull
public List<? extends PackagingElement<?>> chooseAndCreate(@NotNull ArtifactEditorContext context, @NotNull Artifact artifact, @NotNull CompositePackagingElement<?> parent) {
    List<Module> suitableModules = getSuitableModules(context);
    List<Module> selected = context.chooseModules(suitableModules, ProjectBundle.message("dialog.title.packaging.choose.module"));
    final List<PackagingElement<?>> elements = new ArrayList<>();
    final ModulePointerManager pointerManager = ModulePointerManager.getInstance(context.getProject());
    for (Module module : selected) {
        elements.add(createElement(context.getProject(), pointerManager.create(module)));
    }
    return elements;
}
Also used : ArrayList(java.util.ArrayList) PackagingElement(com.intellij.packaging.elements.PackagingElement) CompositePackagingElement(com.intellij.packaging.elements.CompositePackagingElement) ModulePointerManager(com.intellij.openapi.module.ModulePointerManager) Module(com.intellij.openapi.module.Module) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ModulePointerManager

use of com.intellij.openapi.module.ModulePointerManager in project intellij-plugins by JetBrains.

the class DependenciesImpl method loadState.

public void loadState(@NotNull State state, Project project) {
    myTargetPlayer = state.TARGET_PLAYER;
    myComponentSet = state.COMPONENT_SET;
    myFrameworkLinkage = LinkageType.valueOf(state.FRAMEWORK_LINKAGE, DEFAULT_FRAMEWORK_LINKAGE);
    ModulePointerManager pointerManager = ModulePointerManager.getInstance(project);
    myEntries.clear();
    for (EntryState info : state.ENTRIES) {
        if (info.LIBRARY_ID != null) {
            ModuleLibraryEntryImpl libraryEntry = new ModuleLibraryEntryImpl(info.LIBRARY_ID);
            libraryEntry.getDependencyType().loadState(info.DEPENDENCY_TYPE);
            myEntries.add(libraryEntry);
        } else if (info.LIBRARY_NAME != null) {
            SharedLibraryEntryImpl libraryEntry = new SharedLibraryEntryImpl(info.LIBRARY_NAME, info.LIBRARY_LEVEL);
            libraryEntry.getDependencyType().loadState(info.DEPENDENCY_TYPE);
            myEntries.add(libraryEntry);
        } else if (info.BC_NAME != null) {
            BuildConfigurationEntryImpl bcEntry = new BuildConfigurationEntryImpl(pointerManager.create(info.MODULE_NAME), info.BC_NAME);
            bcEntry.getDependencyType().loadState(info.DEPENDENCY_TYPE);
            myEntries.add(bcEntry);
        } else {
            throw new RuntimeException("unknown entry");
        }
    }
    mySdk = state.SDK != null ? new SdkEntryImpl(state.SDK) : null;
    if (mySdk != null && mySdk.getName().isEmpty()) {
        mySdk = null;
    }
}
Also used : ModulePointerManager(com.intellij.openapi.module.ModulePointerManager)

Example 3 with ModulePointerManager

use of com.intellij.openapi.module.ModulePointerManager in project intellij-community by JetBrains.

the class CloudModuleDeploymentRuntimeProviderBase method getDeploymentSources.

@Override
public Collection<DeploymentSource> getDeploymentSources(Project project) {
    List<DeploymentSource> result = new ArrayList<>();
    ModulePointerManager pointerManager = ModulePointerManager.getInstance(project);
    for (Module module : ModuleManager.getInstance(project).getModules()) {
        result.add(new ModuleDeploymentSourceImpl(pointerManager.create(module)));
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) ModuleDeploymentSourceImpl(com.intellij.remoteServer.impl.configuration.deployment.ModuleDeploymentSourceImpl) ModulePointerManager(com.intellij.openapi.module.ModulePointerManager) DeploymentSource(com.intellij.remoteServer.configuration.deployment.DeploymentSource) ModuleDeploymentSource(com.intellij.remoteServer.configuration.deployment.ModuleDeploymentSource) Module(com.intellij.openapi.module.Module)

Aggregations

ModulePointerManager (com.intellij.openapi.module.ModulePointerManager)3 Module (com.intellij.openapi.module.Module)2 ArrayList (java.util.ArrayList)2 CompositePackagingElement (com.intellij.packaging.elements.CompositePackagingElement)1 PackagingElement (com.intellij.packaging.elements.PackagingElement)1 DeploymentSource (com.intellij.remoteServer.configuration.deployment.DeploymentSource)1 ModuleDeploymentSource (com.intellij.remoteServer.configuration.deployment.ModuleDeploymentSource)1 ModuleDeploymentSourceImpl (com.intellij.remoteServer.impl.configuration.deployment.ModuleDeploymentSourceImpl)1 NotNull (org.jetbrains.annotations.NotNull)1