mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
exterminate reflection
This commit is contained in:
+6
-5
@@ -26,10 +26,11 @@ import com.intellij.codeInsight.folding.CodeFoldingSettings;
|
||||
public class BaseCodeFoldingOptionsProvider extends BeanConfigurable<CodeFoldingSettings> 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ import com.intellij.application.options.editor.CodeFoldingOptionsProvider;
|
||||
import com.intellij.openapi.options.BeanConfigurable;
|
||||
|
||||
public class PythonFoldingOptionsProvider extends BeanConfigurable<PythonFoldingSettings> 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ public class PySmartKeysOptions extends BeanConfigurable<CodeInsightSettings> 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,9 @@ import com.jetbrains.python.PyBundle;
|
||||
public class PySpecificSmartKeysOptions extends BeanConfigurable<PyCodeInsightSettings> 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);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -25,8 +25,9 @@ import com.intellij.openapi.project.ProjectManager;
|
||||
public class WebEditorAppearanceConfigurable extends BeanConfigurable<WebEditorOptions> 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
|
||||
|
||||
+5
-4
@@ -26,9 +26,10 @@ import com.intellij.openapi.options.BeanConfigurable;
|
||||
public class XmlCodeFoldingOptionsProvider extends BeanConfigurable<XmlFoldingSettings.State> 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user