diff --git a/platform/lang-impl/src/com/intellij/application/options/editor/BaseCodeFoldingOptionsProvider.java b/platform/lang-impl/src/com/intellij/application/options/editor/BaseCodeFoldingOptionsProvider.java index d6cd348f0893..393e6cd0060c 100644 --- a/platform/lang-impl/src/com/intellij/application/options/editor/BaseCodeFoldingOptionsProvider.java +++ b/platform/lang-impl/src/com/intellij/application/options/editor/BaseCodeFoldingOptionsProvider.java @@ -26,10 +26,11 @@ import com.intellij.codeInsight.folding.CodeFoldingSettings; public class BaseCodeFoldingOptionsProvider extends BeanConfigurable implements CodeFoldingOptionsProvider { public BaseCodeFoldingOptionsProvider() { super(CodeFoldingSettings.getInstance()); - checkBox("COLLAPSE_FILE_HEADER", ApplicationBundle.message("checkbox.collapse.file.header")); - checkBox("COLLAPSE_IMPORTS", ApplicationBundle.message("checkbox.collapse.title.imports")); - checkBox("COLLAPSE_DOC_COMMENTS", ApplicationBundle.message("checkbox.collapse.javadoc.comments")); - checkBox("COLLAPSE_METHODS", ApplicationBundle.message("checkbox.collapse.method.bodies")); - checkBox("COLLAPSE_CUSTOM_FOLDING_REGIONS", ApplicationBundle.message("checkbox.collapse.custom.folding.regions")); + CodeFoldingSettings settings = getInstance(); + checkBox(ApplicationBundle.message("checkbox.collapse.file.header"), ()->settings.COLLAPSE_FILE_HEADER, v->settings.COLLAPSE_FILE_HEADER=v); + checkBox(ApplicationBundle.message("checkbox.collapse.title.imports"), ()->settings.COLLAPSE_IMPORTS, v->settings.COLLAPSE_IMPORTS=v); + checkBox(ApplicationBundle.message("checkbox.collapse.javadoc.comments"), ()->settings.COLLAPSE_DOC_COMMENTS, v->settings.COLLAPSE_DOC_COMMENTS=v); + checkBox(ApplicationBundle.message("checkbox.collapse.method.bodies"), ()->settings.COLLAPSE_METHODS, v->settings.COLLAPSE_METHODS=v); + checkBox(ApplicationBundle.message("checkbox.collapse.custom.folding.regions"), ()->settings.COLLAPSE_CUSTOM_FOLDING_REGIONS, v->settings.COLLAPSE_CUSTOM_FOLDING_REGIONS=v); } } diff --git a/python/src/com/jetbrains/python/PythonFoldingOptionsProvider.java b/python/src/com/jetbrains/python/PythonFoldingOptionsProvider.java index dd090ac64ece..7f3ee8d97e0d 100644 --- a/python/src/com/jetbrains/python/PythonFoldingOptionsProvider.java +++ b/python/src/com/jetbrains/python/PythonFoldingOptionsProvider.java @@ -19,10 +19,10 @@ import com.intellij.application.options.editor.CodeFoldingOptionsProvider; import com.intellij.openapi.options.BeanConfigurable; public class PythonFoldingOptionsProvider extends BeanConfigurable implements CodeFoldingOptionsProvider { - protected PythonFoldingOptionsProvider(PythonFoldingSettings instance) { - super(instance); - checkBox("COLLAPSE_LONG_STRINGS", "Long string literals"); - checkBox("COLLAPSE_LONG_COLLECTIONS", "Long collection literals"); - checkBox("COLLAPSE_SEQUENTIAL_COMMENTS", "Sequential comments"); + protected PythonFoldingOptionsProvider(PythonFoldingSettings settings) { + super(settings); + checkBox("Long string literals", settings::isCollapseLongStrings, v->settings.COLLAPSE_LONG_STRINGS=v); + checkBox("Long collection literals", settings::isCollapseLongCollections, v->settings.COLLAPSE_LONG_COLLECTIONS=v); + checkBox("Sequential comments", settings::isCollapseSequentialComments, v->settings.COLLAPSE_SEQUENTIAL_COMMENTS=v); } } diff --git a/python/src/com/jetbrains/python/codeInsight/PySmartKeysOptions.java b/python/src/com/jetbrains/python/codeInsight/PySmartKeysOptions.java index 9a5226a61416..c225529ea6c0 100644 --- a/python/src/com/jetbrains/python/codeInsight/PySmartKeysOptions.java +++ b/python/src/com/jetbrains/python/codeInsight/PySmartKeysOptions.java @@ -26,6 +26,7 @@ public class PySmartKeysOptions extends BeanConfigurable im public PySmartKeysOptions() { super(CodeInsightSettings.getInstance()); //CodeInsightSettings.getInstance().REFORMAT_ON_PASTE = CodeInsightSettings.NO_REFORMAT; //TODO: remove combobox from settings - checkBox("INDENT_TO_CARET_ON_PASTE", "Smart indent pasted lines"); + CodeInsightSettings settings = getInstance(); + checkBox("Smart indent pasted lines", ()->settings.INDENT_TO_CARET_ON_PASTE, v->settings.INDENT_TO_CARET_ON_PASTE=v); } } diff --git a/python/src/com/jetbrains/python/codeInsight/PySpecificSmartKeysOptions.java b/python/src/com/jetbrains/python/codeInsight/PySpecificSmartKeysOptions.java index 0eb45feced16..f77b5994e8fe 100644 --- a/python/src/com/jetbrains/python/codeInsight/PySpecificSmartKeysOptions.java +++ b/python/src/com/jetbrains/python/codeInsight/PySpecificSmartKeysOptions.java @@ -25,8 +25,9 @@ import com.jetbrains.python.PyBundle; public class PySpecificSmartKeysOptions extends BeanConfigurable implements UnnamedConfigurable { public PySpecificSmartKeysOptions() { super(PyCodeInsightSettings.getInstance()); - checkBox("INSERT_BACKSLASH_ON_WRAP", PyBundle.message("smartKeys.insert.backslash.in.statement.on.enter")); - checkBox("INSERT_SELF_FOR_METHODS", PyBundle.message("smartKeys.insert.self.in.method")); - checkBox("INSERT_TYPE_DOCSTUB", PyBundle.message("smartKeys.insert.type.placeholder.in.docstring.stub")); + PyCodeInsightSettings settings = getInstance(); + checkBox(PyBundle.message("smartKeys.insert.backslash.in.statement.on.enter"), ()->settings.INSERT_BACKSLASH_ON_WRAP, v->settings.INSERT_BACKSLASH_ON_WRAP=v); + checkBox(PyBundle.message("smartKeys.insert.self.in.method"), ()->settings.INSERT_SELF_FOR_METHODS, v->settings.INSERT_SELF_FOR_METHODS=v); + checkBox(PyBundle.message("smartKeys.insert.type.placeholder.in.docstring.stub"), ()->settings.INSERT_TYPE_DOCSTUB, v->settings.INSERT_TYPE_DOCSTUB=v); } } diff --git a/xml/impl/src/com/intellij/application/options/editor/WebEditorAppearanceConfigurable.java b/xml/impl/src/com/intellij/application/options/editor/WebEditorAppearanceConfigurable.java index 77b59cf1836c..290c3da435c3 100644 --- a/xml/impl/src/com/intellij/application/options/editor/WebEditorAppearanceConfigurable.java +++ b/xml/impl/src/com/intellij/application/options/editor/WebEditorAppearanceConfigurable.java @@ -25,8 +25,9 @@ import com.intellij.openapi.project.ProjectManager; public class WebEditorAppearanceConfigurable extends BeanConfigurable implements UnnamedConfigurable { public WebEditorAppearanceConfigurable() { super(WebEditorOptions.getInstance()); - checkBox("showCssColorPreviewInGutter", "Show CSS color preview icon in gutter"); - checkBox("showCssInlineColorPreview", "Show CSS color preview as background"); + WebEditorOptions options = getInstance(); + checkBox("Show CSS color preview icon in gutter", options::isShowCssColorPreviewInGutter, options::setShowCssColorPreviewInGutter); + checkBox("Show CSS color preview as background", options::isShowCssInlineColorPreview, options::setShowCssInlineColorPreview); } @Override diff --git a/xml/impl/src/com/intellij/application/options/editor/XmlCodeFoldingOptionsProvider.java b/xml/impl/src/com/intellij/application/options/editor/XmlCodeFoldingOptionsProvider.java index ace39250c6ed..09101e1a0c55 100644 --- a/xml/impl/src/com/intellij/application/options/editor/XmlCodeFoldingOptionsProvider.java +++ b/xml/impl/src/com/intellij/application/options/editor/XmlCodeFoldingOptionsProvider.java @@ -26,9 +26,10 @@ import com.intellij.openapi.options.BeanConfigurable; public class XmlCodeFoldingOptionsProvider extends BeanConfigurable implements CodeFoldingOptionsProvider { public XmlCodeFoldingOptionsProvider() { super(XmlFoldingSettings.getInstance().getState()); - checkBox("COLLAPSE_XML_TAGS", ApplicationBundle.message("checkbox.collapse.xml.tags")); - checkBox("COLLAPSE_HTML_STYLE_ATTRIBUTE", ApplicationBundle.message("checkbox.collapse.html.style.attribute")); - checkBox("COLLAPSE_ENTITIES", ApplicationBundle.message("checkbox.collapse.entities")); - checkBox("COLLAPSE_DATA_URI", ApplicationBundle.message("checkbox.collapse.data.uri")); + XmlFoldingSettings settings = XmlFoldingSettings.getInstance(); + checkBox(ApplicationBundle.message("checkbox.collapse.xml.tags"), settings::isCollapseXmlTags, value->settings.getState().COLLAPSE_XML_TAGS=value); + checkBox(ApplicationBundle.message("checkbox.collapse.html.style.attribute"),settings::isCollapseHtmlStyleAttribute, value->settings.getState().COLLAPSE_HTML_STYLE_ATTRIBUTE=value); + checkBox(ApplicationBundle.message("checkbox.collapse.entities"),settings::isCollapseEntities, value->settings.getState().COLLAPSE_ENTITIES=value); + checkBox(ApplicationBundle.message("checkbox.collapse.data.uri"),settings::isCollapseDataUri, value->settings.getState().COLLAPSE_DATA_URI=value); } } \ No newline at end of file