mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add extension point for registry keys (IDEA-CR-36577, IDEA-177378)
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
// Copyright 2000-2018 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.openapi.util.registry
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName
|
||||
import com.intellij.util.xmlb.annotations.Attribute
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
class RegistryKeyBean {
|
||||
@JvmField @Attribute("key") val key: String = ""
|
||||
@JvmField @Attribute("description") val description: String = ""
|
||||
@JvmField @Attribute("defaultValue") val defaultValue: String = ""
|
||||
@JvmField @Attribute("restartRequired") val restartRequired: Boolean = false
|
||||
|
||||
companion object {
|
||||
val EP_NAME = ExtensionPointName.create<RegistryKeyBean>("com.intellij.registryKey")
|
||||
}
|
||||
}
|
||||
|
||||
class RegistryExtensionCollector {
|
||||
init {
|
||||
for (extension in RegistryKeyBean.EP_NAME.extensions) {
|
||||
Registry.addKey(extension.key, extension.description, extension.defaultValue, extension.restartRequired)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -323,5 +323,7 @@
|
||||
beanClass="com.intellij.lang.LanguageExtensionPoint">
|
||||
<with attribute="implementationClass" implements="com.intellij.injected.editor.InjectedFileChangesHandlerProvider"/>
|
||||
</extensionPoint>
|
||||
|
||||
<extensionPoint qualifiedName="com.intellij.registryKey" beanClass="com.intellij.openapi.util.registry.RegistryKeyBean"/>
|
||||
</extensionPoints>
|
||||
</idea-plugin>
|
||||
|
||||
@@ -147,6 +147,10 @@
|
||||
<component>
|
||||
<implementation-class>com.intellij.diagnostic.LowMemoryNotifier</implementation-class>
|
||||
</component>
|
||||
|
||||
<component>
|
||||
<implementation-class>com.intellij.openapi.util.registry.RegistryExtensionCollector</implementation-class>
|
||||
</component>
|
||||
</application-components>
|
||||
|
||||
<project-components>
|
||||
|
||||
Reference in New Issue
Block a user