CWM-1649 add an extension point to hide refactorings section in Code Editing settings page, use it in CWM guest

GitOrigin-RevId: da57142738bc72ef7cf3d2a6915ad6f9b730ea6a
This commit is contained in:
Nikolay Kuznetsov
2021-03-22 19:50:25 +00:00
committed by intellij-monorepo-bot
parent 557b268ab4
commit d06b9eb6cb
3 changed files with 27 additions and 9 deletions
@@ -0,0 +1,14 @@
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.application.options.editor
import com.intellij.openapi.extensions.ExtensionPointName
import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
interface EditorOptionsPageCustomizer {
fun shouldHideRefactoringsSection(): Boolean
companion object {
val EP_NAME = ExtensionPointName<EditorOptionsPageCustomizer>("com.intellij.generalEditorOptionsCustomizer")
}
}
@@ -301,18 +301,20 @@ class EditorCodeEditingConfigurable : BoundCompositeConfigurable<ErrorOptionsPro
row { checkBox(highlightScope) }
row { checkBox(highlightIdentifierUnderCaret) }
}
titledRow(message("group.refactorings")) {
row {
buttonGroup(editorSettings::isVariableInplaceRenameEnabled,
editorSettings::setVariableInplaceRenameEnabled) {
checkBoxGroup(message("radiogroup.rename.local.variables")) {
row { radioButton(message("radiobutton.rename.local.variables.inplace"), value = true) }
row { radioButton(message("radiobutton.rename.local.variables.in.dialog"), value = false) }.largeGapAfter()
if (!EditorOptionsPageCustomizer.EP_NAME.extensions().anyMatch { it.shouldHideRefactoringsSection() }) {
titledRow(message("group.refactorings")) {
row {
buttonGroup(editorSettings::isVariableInplaceRenameEnabled,
editorSettings::setVariableInplaceRenameEnabled) {
checkBoxGroup(message("radiogroup.rename.local.variables")) {
row { radioButton(message("radiobutton.rename.local.variables.inplace"), value = true) }
row { radioButton(message("radiobutton.rename.local.variables.in.dialog"), value = false) }.largeGapAfter()
}
}
}
row { checkBox(preselectCheckBox) }
row { checkBox(showInlineDialogForCheckBox) }
}
row { checkBox(preselectCheckBox) }
row { checkBox(showInlineDialogForCheckBox) }
}
titledRow(message("group.error.highlighting")) {
row {
@@ -27,6 +27,8 @@
<with attribute="instance" implements="com.intellij.openapi.options.UnnamedConfigurable" />
</extensionPoint>
<extensionPoint dynamic="true" name="generalEditorOptionsCustomizer" interface="com.intellij.application.options.editor.EditorOptionsPageCustomizer"/>
<!--quote handlers-->
<extensionPoint name="quoteHandler" beanClass="com.intellij.codeInsight.editorActions.QuoteHandlerEP" dynamic="true">
<with attribute="className" implements="com.intellij.codeInsight.editorActions.QuoteHandler"/>