diff --git a/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsForm.form b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsForm.form
index e5ee0c6eb0c3..4dd9851442ca 100644
--- a/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsForm.form
+++ b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsForm.form
@@ -8,7 +8,7 @@
-
+
@@ -54,12 +54,20 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsProvider.java b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsProvider.java
index 1f437f870dd6..292e3e11826d 100644
--- a/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsProvider.java
+++ b/xml/impl/src/com/intellij/application/options/editor/WebEditorOptionsProvider.java
@@ -32,6 +32,7 @@ public class WebEditorOptionsProvider implements EditorOptionsProvider {
private JCheckBox myAutomaticallyInsertRequiredSubTagsCheckBox;
private JCheckBox myAutomaticallyStartAttributeAfterCheckBox;
private JBCheckBox mySelectWholeSelectorOnDoubleClick;
+ private JBCheckBox myAddQuotasForAttributeValue;
public String getDisplayName() {
@@ -46,15 +47,14 @@ public class WebEditorOptionsProvider implements EditorOptionsProvider {
return myWholePanel;
}
-
-
public boolean isModified() {
final WebEditorOptions xmlEditorOptions = WebEditorOptions.getInstance();
return xmlEditorOptions.isAutomaticallyInsertClosingTag() != myAutomaticallyInsertClosingTagCheckBox.isSelected() ||
xmlEditorOptions.isAutomaticallyInsertRequiredAttributes() != myAutomaticallyInsertRequiredAttributesCheckBox.isSelected() ||
xmlEditorOptions.isAutomaticallyStartAttribute() != myAutomaticallyStartAttributeAfterCheckBox.isSelected() ||
xmlEditorOptions.isSelectWholeCssSelectorSuffixOnDoubleClick() != mySelectWholeSelectorOnDoubleClick.isSelected() ||
- xmlEditorOptions.isAutomaticallyInsertRequiredSubTags() != myAutomaticallyInsertRequiredSubTagsCheckBox.isSelected();
+ xmlEditorOptions.isAutomaticallyInsertRequiredSubTags() != myAutomaticallyInsertRequiredSubTagsCheckBox.isSelected() ||
+ xmlEditorOptions.isInsertQuotesForAttributeValue() != myAddQuotasForAttributeValue.isSelected();
}
public void apply() throws ConfigurationException {
@@ -64,6 +64,7 @@ public class WebEditorOptionsProvider implements EditorOptionsProvider {
xmlEditorOptions.setAutomaticallyInsertRequiredSubTags(myAutomaticallyInsertRequiredSubTagsCheckBox.isSelected());
xmlEditorOptions.setAutomaticallyStartAttribute(myAutomaticallyStartAttributeAfterCheckBox.isSelected());
xmlEditorOptions.setSelectWholeCssSelectorSuffixOnDoubleClick(mySelectWholeSelectorOnDoubleClick.isSelected());
+ xmlEditorOptions.setInsertQuotesForAttributeValue(myAddQuotasForAttributeValue.isSelected());
}
public void reset() {
@@ -73,6 +74,7 @@ public class WebEditorOptionsProvider implements EditorOptionsProvider {
myAutomaticallyInsertRequiredSubTagsCheckBox.setSelected(xmlEditorOptions.isAutomaticallyInsertRequiredSubTags());
myAutomaticallyStartAttributeAfterCheckBox.setSelected(xmlEditorOptions.isAutomaticallyStartAttribute());
mySelectWholeSelectorOnDoubleClick.setSelected(xmlEditorOptions.isSelectWholeCssSelectorSuffixOnDoubleClick());
+ myAddQuotasForAttributeValue.setSelected(xmlEditorOptions.isInsertQuotesForAttributeValue());
}
public void disposeUIResources() {
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlEqTypedHandler.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlEqTypedHandler.java
index 0e09baa2ec57..922d910dffc2 100644
--- a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlEqTypedHandler.java
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlEqTypedHandler.java
@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.editorActions;
+import com.intellij.application.options.editor.WebEditorOptions;
import com.intellij.codeInsight.AutoPopupController;
import com.intellij.lang.xml.XMLLanguage;
import com.intellij.openapi.editor.Editor;
@@ -34,12 +35,15 @@ public class XmlEqTypedHandler extends TypedHandlerDelegate {
Editor editor,
PsiFile file,
FileType fileType) {
- boolean inXml = file.getLanguage() instanceof XMLLanguage || file.getViewProvider().getBaseLanguage() instanceof XMLLanguage;
- if (c == '=' && inXml) {
- int offset = editor.getCaretModel().getOffset();
- PsiElement at = file.findElementAt(offset - 1);
- PsiElement atParent = at != null ? at.getParent() : null;
- needToInsertQuotes = atParent instanceof XmlAttribute && ((XmlAttribute)atParent).getValueElement() == null;
+
+ if (WebEditorOptions.getInstance().isInsertQuotesForAttributeValue()) {
+ boolean inXml = file.getLanguage() instanceof XMLLanguage || file.getViewProvider().getBaseLanguage() instanceof XMLLanguage;
+ if (c == '=' && inXml) {
+ int offset = editor.getCaretModel().getOffset();
+ PsiElement at = file.findElementAt(offset - 1);
+ PsiElement atParent = at != null ? at.getParent() : null;
+ needToInsertQuotes = atParent instanceof XmlAttribute && ((XmlAttribute)atParent).getValueElement() == null;
+ }
}
return super.beforeCharTyped(c, project, editor, file, fileType);
diff --git a/xml/xml-analysis-impl/src/com/intellij/application/options/editor/WebEditorOptions.java b/xml/xml-analysis-impl/src/com/intellij/application/options/editor/WebEditorOptions.java
index aff6054fe055..f3504e66ac6c 100644
--- a/xml/xml-analysis-impl/src/com/intellij/application/options/editor/WebEditorOptions.java
+++ b/xml/xml-analysis-impl/src/com/intellij/application/options/editor/WebEditorOptions.java
@@ -45,6 +45,7 @@ public class WebEditorOptions implements PersistentStateComponent