From 9775dfcd0ef754f3cb2efa180715e407bfa0bcbc Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Fri, 20 May 2011 17:37:49 +0400 Subject: [PATCH] IDEA-63305 IDEA WebModule --- .../openapi/module/PlatformWebModuleType.java | 52 +++++++++++++++++++ .../src/messages/ProjectBundle.properties | 2 + 2 files changed, 54 insertions(+) create mode 100644 platform/lang-impl/src/com/intellij/openapi/module/PlatformWebModuleType.java diff --git a/platform/lang-impl/src/com/intellij/openapi/module/PlatformWebModuleType.java b/platform/lang-impl/src/com/intellij/openapi/module/PlatformWebModuleType.java new file mode 100644 index 000000000000..134caaa150e6 --- /dev/null +++ b/platform/lang-impl/src/com/intellij/openapi/module/PlatformWebModuleType.java @@ -0,0 +1,52 @@ +package com.intellij.openapi.module; + +import com.intellij.ide.util.projectWizard.EmptyModuleBuilder; +import com.intellij.openapi.application.ApplicationInfo; +import com.intellij.openapi.application.ex.ApplicationInfoEx; +import com.intellij.openapi.project.ProjectBundle; +import com.intellij.openapi.util.IconLoader; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; + +import javax.swing.*; + +/** + * @author yole + */ +public class PlatformWebModuleType extends ModuleType { + @NonNls public static final String WEB_MODULE = "WEB_MODULE"; + + public PlatformWebModuleType() { + super(WEB_MODULE); + } + + @NotNull + public static PlatformWebModuleType getInstance() { + return (PlatformWebModuleType)ModuleTypeManager.getInstance().findByID(WEB_MODULE); + } + + public EmptyModuleBuilder createModuleBuilder() { + return new EmptyModuleBuilder() { + @Override + public ModuleType getModuleType() { + return getInstance(); + } + }; + } + + public String getName() { + return ProjectBundle.message("module.web.title"); + } + + public String getDescription() { + return ProjectBundle.message("module.web.description"); + } + + public Icon getBigIcon() { + return IconLoader.getIcon(((ApplicationInfoEx)ApplicationInfo.getInstance()).getSmallIconUrl()); + } + + public Icon getNodeIcon(boolean isOpened) { + return getBigIcon(); + } +} \ No newline at end of file diff --git a/platform/platform-resources-en/src/messages/ProjectBundle.properties b/platform/platform-resources-en/src/messages/ProjectBundle.properties index caf8510f511a..c1402937098f 100644 --- a/platform/platform-resources-en/src/messages/ProjectBundle.properties +++ b/platform/platform-resources-en/src/messages/ProjectBundle.properties @@ -253,6 +253,8 @@ module.corrupted.data.error=Corrupted module data at: {0} module.unknown.type.single.error=Cannot determine module type for the following module:\n\"{0}\"\nThe module will be treated as a Unknown module. module.unknown.type.multiple.error=Cannot determine module type for the following modules:\n{0}\nAll mentioned modules will be treated as Unknown modules. module.unknown.type.title=Unknown Module Type +module.web.title=Web Module +module.web.description=Provides facilities for developing web applications. module.remove.from.project.confirmation=Would you like to remove module ''{0}'' from the project? element.kind.name.module=module module.file.does.not.exist.error=File {0} does not exist