diff --git a/build/scripts/layouts.gant b/build/scripts/layouts.gant
index 36093b474d7c..d23727fb896d 100644
--- a/build/scripts/layouts.gant
+++ b/build/scripts/layouts.gant
@@ -249,7 +249,7 @@ public def layoutCommunityPlugins(String home) {
}
dir("plugins") {
- def simplePlugins = ["commander", "copyright", "properties", "java-i18n", "hg4idea", "github", "ui-designer-core"] //, "tasks-time-tracking"]
+ def simplePlugins = ["commander", "copyright", "java-i18n", "hg4idea", "github", "ui-designer-core"] //, "tasks-time-tracking"]
simplePlugins.each {
layoutPlugin it
@@ -268,6 +268,16 @@ public def layoutCommunityPlugins(String home) {
}
}
+ dir("properties") {
+ dir("lib") {
+ jar("properties.jar") {
+ module("properties-psi-api")
+ module("properties-psi-impl")
+ module("properties")
+ }
+ }
+ }
+
layoutPlugin("maven") {
jar("maven-jps-plugin.jar") {
module("maven-jps-plugin")
diff --git a/platform/platform-resources-en/src/messages/OptionsBundle.properties b/platform/platform-resources-en/src/messages/OptionsBundle.properties
index b1ff8c4f62a3..364c5b48fe33 100644
--- a/platform/platform-resources-en/src/messages/OptionsBundle.properties
+++ b/platform/platform-resources-en/src/messages/OptionsBundle.properties
@@ -98,13 +98,6 @@ options.java.attribute.descriptor.recursive.call=Recursive calls highlighting
options.java.attribute.descriptor.annotation.name=Annotation name
options.java.attribute.descriptor.annotation.attribute.name=Annotation attribute name
-options.properties.attribute.descriptor.property.key=Property key
-options.properties.attribute.descriptor.property.value=Property value
-options.properties.attribute.descriptor.key.value.separator=Key/value separator
-options.properties.attribute.descriptor.comment=Comment
-options.properties.attribute.descriptor.valid.string.escape=Valid string escape
-options.properties.attribute.descriptor.invalid.string.escape=Invalid string escape
-
options.xml.attribute.descriptor.prologue=Prologue
options.xml.attribute.descriptor.comment=Comment
options.xml.attribute.descriptor.tag=Tag
diff --git a/plugins/groovy/jetgroovy.iml b/plugins/groovy/jetgroovy.iml
index bd8506caffbb..c8bb19d97eb1 100644
--- a/plugins/groovy/jetgroovy.iml
+++ b/plugins/groovy/jetgroovy.iml
@@ -35,6 +35,7 @@
+
diff --git a/plugins/java-i18n/java-i18n.iml b/plugins/java-i18n/java-i18n.iml
index eed7b0a7cdec..b15f5c1588f5 100644
--- a/plugins/java-i18n/java-i18n.iml
+++ b/plugins/java-i18n/java-i18n.iml
@@ -19,6 +19,7 @@
+
diff --git a/plugins/maven/maven.iml b/plugins/maven/maven.iml
index c15aa891282b..f64460936c7a 100644
--- a/plugins/maven/maven.iml
+++ b/plugins/maven/maven.iml
@@ -62,6 +62,7 @@
+
diff --git a/plugins/properties/properties-psi-api/properties-psi-api.iml b/plugins/properties/properties-psi-api/properties-psi-api.iml
new file mode 100644
index 000000000000..d62c1453978b
--- /dev/null
+++ b/plugins/properties/properties-psi-api/properties-psi-api.iml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/properties/resources/messages/PropertiesBundle.properties b/plugins/properties/properties-psi-api/resources/messages/PropertiesBundle.properties
similarity index 84%
rename from plugins/properties/resources/messages/PropertiesBundle.properties
rename to plugins/properties/properties-psi-api/resources/messages/PropertiesBundle.properties
index 237deda93c0d..0864d1e31206 100644
--- a/plugins/properties/resources/messages/PropertiesBundle.properties
+++ b/plugins/properties/properties-psi-api/resources/messages/PropertiesBundle.properties
@@ -33,4 +33,11 @@ action.I18nize.text=Internationali_ze...
action.I18nize.description=Replace Java string literal or JSP text with internationalized expression
create.property.quickfix.text=Create Property
unescape=Unescape
-trail.spaces.property.inspection.display.name=Trailing Spaces in Property
\ No newline at end of file
+trail.spaces.property.inspection.display.name=Trailing Spaces in Property
+
+options.properties.attribute.descriptor.property.key=Property key
+options.properties.attribute.descriptor.property.value=Property value
+options.properties.attribute.descriptor.key.value.separator=Key/value separator
+options.properties.attribute.descriptor.comment=Comment
+options.properties.attribute.descriptor.valid.string.escape=Valid string escape
+options.properties.attribute.descriptor.invalid.string.escape=Invalid string escape
\ No newline at end of file
diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesBundle.java b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesBundle.java
similarity index 100%
rename from plugins/properties/src/com/intellij/lang/properties/PropertiesBundle.java
rename to plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesBundle.java
diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesFileType.java b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesFileType.java
similarity index 81%
rename from plugins/properties/src/com/intellij/lang/properties/PropertiesFileType.java
rename to plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesFileType.java
index f1bc0f742907..6d9d3eef17a4 100644
--- a/plugins/properties/src/com/intellij/lang/properties/PropertiesFileType.java
+++ b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesFileType.java
@@ -19,7 +19,7 @@ import com.intellij.icons.AllIcons;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.openapi.vfs.encoding.EncodingManager;
+import com.intellij.openapi.vfs.encoding.EncodingRegistry;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -63,7 +63,12 @@ public class PropertiesFileType extends LanguageFileType {
@Override
public String getCharset(@NotNull VirtualFile file, final byte[] content) {
- Charset charset = EncodingManager.getInstance().getDefaultCharsetForPropertiesFiles(file);
- return charset == null ? CharsetToolkit.getDefaultSystemCharset().name() : charset.name();
+ final EncodingRegistry encodingManager = EncodingRegistry.getInstance();
+ if (encodingManager != null) {
+ final Charset encoding = encodingManager.getEncoding(file, true);
+ if (encoding != null) return encoding.toString();
+ }
+ final Charset charset = CharsetToolkit.getDefaultSystemCharset();
+ return charset != null ? charset.toString() : null;
}
}
diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesHighlighter.java b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesHighlighter.java
similarity index 84%
rename from plugins/properties/src/com/intellij/lang/properties/PropertiesHighlighter.java
rename to plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesHighlighter.java
index 2d5f6a3299e5..cb198d649ca9 100644
--- a/plugins/properties/src/com/intellij/lang/properties/PropertiesHighlighter.java
+++ b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesHighlighter.java
@@ -21,7 +21,6 @@ import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
-import com.intellij.openapi.options.OptionsBundle;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.StringEscapesTokenTypes;
import com.intellij.psi.tree.IElementType;
@@ -87,16 +86,16 @@ public class PropertiesHighlighter extends SyntaxHighlighterBase {
@NotNull
public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
- return pack(keys1.get(tokenType), keys2.get(tokenType));
+ return SyntaxHighlighterBase.pack(keys1.get(tokenType), keys2.get(tokenType));
}
public static final Map> DISPLAY_NAMES = new THashMap>(6);
static {
- DISPLAY_NAMES.put(PROPERTY_KEY, new Pair(OptionsBundle.message("options.properties.attribute.descriptor.property.key"),null));
- DISPLAY_NAMES.put(PROPERTY_VALUE, new Pair(OptionsBundle.message("options.properties.attribute.descriptor.property.value"), null));
- DISPLAY_NAMES.put(PROPERTY_KEY_VALUE_SEPARATOR, new Pair(OptionsBundle.message("options.properties.attribute.descriptor.key.value.separator"), null));
- DISPLAY_NAMES.put(PROPERTY_COMMENT, new Pair(OptionsBundle.message("options.properties.attribute.descriptor.comment"), null));
- DISPLAY_NAMES.put(PROPERTIES_VALID_STRING_ESCAPE, new Pair(OptionsBundle.message("options.properties.attribute.descriptor.valid.string.escape"), null));
- DISPLAY_NAMES.put(PROPERTIES_INVALID_STRING_ESCAPE, new Pair(OptionsBundle.message("options.properties.attribute.descriptor.invalid.string.escape"), HighlightSeverity.WARNING));
+ DISPLAY_NAMES.put(PROPERTY_KEY, new Pair(PropertiesBundle.message("options.properties.attribute.descriptor.property.key"),null));
+ DISPLAY_NAMES.put(PROPERTY_VALUE, new Pair(PropertiesBundle.message("options.properties.attribute.descriptor.property.value"), null));
+ DISPLAY_NAMES.put(PROPERTY_KEY_VALUE_SEPARATOR, new Pair(PropertiesBundle.message("options.properties.attribute.descriptor.key.value.separator"), null));
+ DISPLAY_NAMES.put(PROPERTY_COMMENT, new Pair(PropertiesBundle.message("options.properties.attribute.descriptor.comment"), null));
+ DISPLAY_NAMES.put(PROPERTIES_VALID_STRING_ESCAPE, new Pair(PropertiesBundle.message("options.properties.attribute.descriptor.valid.string.escape"), null));
+ DISPLAY_NAMES.put(PROPERTIES_INVALID_STRING_ESCAPE, new Pair(PropertiesBundle.message("options.properties.attribute.descriptor.invalid.string.escape"), HighlightSeverity.WARNING));
}
}
diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesHighlightingLexer.java b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesHighlightingLexer.java
similarity index 100%
rename from plugins/properties/src/com/intellij/lang/properties/PropertiesHighlightingLexer.java
rename to plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesHighlightingLexer.java
diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesLanguage.java b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesLanguage.java
similarity index 100%
rename from plugins/properties/src/com/intellij/lang/properties/PropertiesLanguage.java
rename to plugins/properties/properties-psi-api/src/com/intellij/lang/properties/PropertiesLanguage.java
diff --git a/plugins/properties/src/com/intellij/lang/properties/parsing/PropertiesElementType.java b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/parsing/PropertiesElementType.java
similarity index 89%
rename from plugins/properties/src/com/intellij/lang/properties/parsing/PropertiesElementType.java
rename to plugins/properties/properties-psi-api/src/com/intellij/lang/properties/parsing/PropertiesElementType.java
index 48c930e43ae0..32e8d4a6dba1 100644
--- a/plugins/properties/src/com/intellij/lang/properties/parsing/PropertiesElementType.java
+++ b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/parsing/PropertiesElementType.java
@@ -15,8 +15,8 @@
*/
package com.intellij.lang.properties.parsing;
+import com.intellij.lang.properties.PropertiesLanguage;
import com.intellij.psi.tree.IElementType;
-import com.intellij.openapi.fileTypes.StdFileTypes;
import org.jetbrains.annotations.NonNls;
/**
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.NonNls;
*/
public class PropertiesElementType extends IElementType {
public PropertiesElementType(@NonNls String debugName) {
- super(debugName, StdFileTypes.PROPERTIES.getLanguage());
+ super(debugName, PropertiesLanguage.INSTANCE);
}
@SuppressWarnings({"HardCodedStringLiteral"})
diff --git a/plugins/properties/src/com/intellij/lang/properties/parsing/PropertiesLexer.java b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/parsing/PropertiesLexer.java
similarity index 100%
rename from plugins/properties/src/com/intellij/lang/properties/parsing/PropertiesLexer.java
rename to plugins/properties/properties-psi-api/src/com/intellij/lang/properties/parsing/PropertiesLexer.java
diff --git a/plugins/properties/src/com/intellij/lang/properties/parsing/PropertiesTokenTypes.java b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/parsing/PropertiesTokenTypes.java
similarity index 100%
rename from plugins/properties/src/com/intellij/lang/properties/parsing/PropertiesTokenTypes.java
rename to plugins/properties/properties-psi-api/src/com/intellij/lang/properties/parsing/PropertiesTokenTypes.java
diff --git a/plugins/properties/src/com/intellij/lang/properties/parsing/_PropertiesLexer.java b/plugins/properties/properties-psi-api/src/com/intellij/lang/properties/parsing/_PropertiesLexer.java
similarity index 100%
rename from plugins/properties/src/com/intellij/lang/properties/parsing/_PropertiesLexer.java
rename to plugins/properties/properties-psi-api/src/com/intellij/lang/properties/parsing/_PropertiesLexer.java
diff --git a/plugins/properties/properties-psi-impl/properties-psi-impl.iml b/plugins/properties/properties-psi-impl/properties-psi-impl.iml
new file mode 100644
index 000000000000..7878d547489b
--- /dev/null
+++ b/plugins/properties/properties-psi-impl/properties-psi-impl.iml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/properties/PropertiesCoreEnvironment.java b/plugins/properties/properties-psi-impl/src/com/intellij/properties/PropertiesCoreEnvironment.java
new file mode 100644
index 000000000000..6fd39024c9c3
--- /dev/null
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/properties/PropertiesCoreEnvironment.java
@@ -0,0 +1,21 @@
+package com.intellij.properties;
+
+import com.intellij.core.CoreApplicationEnvironment;
+import com.intellij.core.CoreProjectEnvironment;
+import com.intellij.lang.properties.PropertiesFileType;
+
+/**
+ * @author Anna Bulenkova
+ */
+public class PropertiesCoreEnvironment {
+ public static class ApplicationEnvironment {
+ public ApplicationEnvironment(CoreApplicationEnvironment appEnvironment) {
+ appEnvironment.registerFileType(PropertiesFileType.INSTANCE, "properties");
+ }
+ }
+
+ public static class ProjectEnvironment {
+ public ProjectEnvironment(CoreProjectEnvironment projectEnvironment) {
+ }
+ }
+}
diff --git a/plugins/properties/properties.iml b/plugins/properties/properties.iml
index 3aa5283970cb..ae5c42e72580 100644
--- a/plugins/properties/properties.iml
+++ b/plugins/properties/properties.iml
@@ -19,6 +19,8 @@
+
+
diff --git a/plugins/ui-designer/ui-designer.iml b/plugins/ui-designer/ui-designer.iml
index bf40bb28c9cb..49c19873c4b1 100644
--- a/plugins/ui-designer/ui-designer.iml
+++ b/plugins/ui-designer/ui-designer.iml
@@ -28,6 +28,7 @@
+