diff options
author | Tor Norbye <tnorbye@google.com> | 2014-08-19 12:53:10 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-08-19 12:53:10 -0700 |
commit | 02cf98d65c798d368fcec43ed64a001d513bdd4f (patch) | |
tree | e39e210ab20917b7e5ffdce14a42f5747506eed0 /java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java | |
parent | 2e5965e996aad62ab1338b09d54caaf99ff3dd6a (diff) | |
download | idea-02cf98d65c798d368fcec43ed64a001d513bdd4f.tar.gz |
Snapshot idea/138.1503 from git://git.jetbrains.org/idea/community.git
Change-Id: Ie01af1d8710ec0ff51d90301bda1a18b0b5c0faf
Diffstat (limited to 'java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java')
-rw-r--r-- | java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java index 6643c89cc1c4..dd2d9d9af563 100644 --- a/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java +++ b/java/remote-servers/impl/src/com/intellij/remoteServer/impl/module/CloudModuleBuilderContribution.java @@ -16,33 +16,51 @@ package com.intellij.remoteServer.impl.module; import com.intellij.openapi.Disposable; -import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ModifiableRootModel; import com.intellij.remoteServer.ServerType; -import com.intellij.remoteServer.configuration.RemoteServer; +import com.intellij.remoteServer.configuration.deployment.DeploymentConfiguration; +import com.intellij.remoteServer.configuration.deployment.DeploymentSource; import org.jetbrains.annotations.Nullable; public abstract class CloudModuleBuilderContribution { - public static final ExtensionPointName<CloudModuleBuilderContribution> EP_NAME - = ExtensionPointName.create("com.intellij.remoteServer.moduleBuilderContribution"); + private final CloudModuleBuilder myModuleBuilder; - public abstract ServerType<?> getCloudType(); + private final ServerType<?> myCloudType; + private CloudApplicationConfigurable myApplicationConfigurable; - public abstract CloudApplicationConfigurable createApplicationConfigurable(@Nullable Project project, Disposable parentDisposable); + public CloudModuleBuilderContribution(CloudModuleBuilder moduleBuilder, ServerType<?> cloudType) { + myModuleBuilder = moduleBuilder; + myCloudType = cloudType; + } + + protected CloudModuleBuilder getModuleBuilder() { + return myModuleBuilder; + } - public abstract void configureModule(Module module, - RemoteServer<?> account, - CloudApplicationConfiguration configuration); + protected ServerType<?> getCloudType() { + return myCloudType; + } - public static CloudModuleBuilderContribution getInstanceByType(ServerType<?> cloudType) { - for (CloudModuleBuilderContribution contribution : EP_NAME.getExtensions()) { - if (contribution.getCloudType() == cloudType) { - return contribution; - } + public CloudApplicationConfigurable getApplicationConfigurable(@Nullable Project project, Disposable parentDisposable) { + if (myApplicationConfigurable == null) { + myApplicationConfigurable = createApplicationConfigurable(project, parentDisposable); } - return null; + return myApplicationConfigurable; + } + + public void preConfigureModule(Module module, ModifiableRootModel model) { + + } + + public abstract void configureModule(Module module); + + protected abstract CloudApplicationConfigurable createApplicationConfigurable(@Nullable Project project, Disposable parentDisposable); + + protected DeploymentConfiguration createDeploymentConfiguration(DeploymentSource deploymentSource) { + return myCloudType.createDeploymentConfigurator(null).createDefaultConfiguration(deploymentSource); } } |