IDEADEV-41116: exploded war artefact: add warning for dependent module
authornik <Nikolay.Chashnikov@jetbrains.com>
Tue, 24 Nov 2009 07:04:41 +0000 (10:04 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Tue, 24 Nov 2009 07:04:41 +0000 (10:04 +0300)
java/compiler/openapi/src/com/intellij/packaging/ui/ArtifactEditor.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactEditorImpl.java

index e8b481e277a8638ce3e1e4c90ec138a3c0b78e43..4609d97c51da7fbf77797de2ce09b2e554e128f5 100644 (file)
  */
 package com.intellij.packaging.ui;
 
-import org.jetbrains.annotations.NotNull;
+import com.intellij.openapi.module.Module;
 import com.intellij.openapi.roots.libraries.Library;
 import com.intellij.packaging.elements.CompositePackagingElement;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.List;
 
@@ -29,5 +30,7 @@ public interface ArtifactEditor {
 
   void putLibraryIntoDefaultLocation(@NotNull Library library);
 
+  void putModuleIntoDefaultLocation(@NotNull Module module);
+
   void addToClasspath(CompositePackagingElement<?> element, List<String> classpath);
 }
index 6be66d8c1721d6e7902d27e628e4c13f856c60b1..5f17e12c671f93ee20c22f99d296b7830bd65491 100644 (file)
@@ -22,11 +22,13 @@ import com.intellij.ide.impl.TypeSafeDataProviderAdapter;
 import com.intellij.openapi.actionSystem.*;
 import com.intellij.openapi.compiler.CompilerBundle;
 import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
+import com.intellij.openapi.module.Module;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.project.ProjectBundle;
 import com.intellij.openapi.roots.libraries.Library;
 import com.intellij.openapi.roots.ui.configuration.artifacts.actions.*;
 import com.intellij.openapi.roots.ui.configuration.artifacts.sourceItems.LibrarySourceItem;
+import com.intellij.openapi.roots.ui.configuration.artifacts.sourceItems.ModuleOutputSourceItem;
 import com.intellij.openapi.roots.ui.configuration.artifacts.sourceItems.SourceItemsTree;
 import com.intellij.openapi.ui.FixedSizeButton;
 import com.intellij.openapi.ui.Splitter;
@@ -380,6 +382,10 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
     myLayoutTreeComponent.putIntoDefaultLocations(Collections.singletonList(new LibrarySourceItem(library)));
   }
 
+  public void putModuleIntoDefaultLocation(@NotNull Module module) {
+    myLayoutTreeComponent.putIntoDefaultLocations(Collections.singletonList(new ModuleOutputSourceItem(module)));
+  }
+
   public void addToClasspath(final CompositePackagingElement<?> element, List<String> classpath) {
     myLayoutTreeComponent.saveElementProperties();
     ManifestFileConfiguration manifest = myContext.getManifestFile(element, getArtifact().getArtifactType());