mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-25499: artifacts config: UI for easy configuration of exploded wars
This commit is contained in:
@@ -17,6 +17,7 @@ package com.intellij.packaging.artifacts;
|
||||
|
||||
import com.intellij.packaging.elements.CompositePackagingElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
@@ -25,10 +26,50 @@ public abstract class ArtifactTemplate {
|
||||
|
||||
public abstract String getPresentableName();
|
||||
|
||||
public abstract CompositePackagingElement<?> createRootElement(@NotNull String artifactName);
|
||||
/**
|
||||
* @deprecated override {@link #createArtifact()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public CompositePackagingElement<?> createRootElement(@NotNull String artifactName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated override {@link #createArtifact()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
@NotNull
|
||||
public String suggestArtifactName() {
|
||||
return "unnamed";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public NewArtifactConfiguration createArtifact() {
|
||||
final String name = suggestArtifactName();
|
||||
return new NewArtifactConfiguration(createRootElement(name), name, null);
|
||||
}
|
||||
|
||||
public static class NewArtifactConfiguration {
|
||||
private final CompositePackagingElement<?> myRootElement;
|
||||
private final String myArtifactName;
|
||||
private final ArtifactType myArtifactType;
|
||||
|
||||
public NewArtifactConfiguration(CompositePackagingElement<?> rootElement, String artifactName, ArtifactType artifactType) {
|
||||
myRootElement = rootElement;
|
||||
myArtifactName = artifactName;
|
||||
myArtifactType = artifactType;
|
||||
}
|
||||
|
||||
public CompositePackagingElement<?> getRootElement() {
|
||||
return myRootElement;
|
||||
}
|
||||
|
||||
public String getArtifactName() {
|
||||
return myArtifactName;
|
||||
}
|
||||
|
||||
public ArtifactType getArtifactType() {
|
||||
return myArtifactType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user