From 0e5a351d65bff527bd0dba9b2096ffde32ca3cbb Mon Sep 17 00:00:00 2001 From: Edoardo Luppi Date: Mon, 2 Aug 2021 19:32:24 +0200 Subject: [PATCH] refactor: replace deprecated AbstractExtensionPointBean with LazyExtensionInstance --- .../github/lppedd/cc/api/WhatsNewProvider.kt | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/github/lppedd/cc/api/WhatsNewProvider.kt b/src/main/kotlin/com/github/lppedd/cc/api/WhatsNewProvider.kt index f0c0648..4cda81f 100644 --- a/src/main/kotlin/com/github/lppedd/cc/api/WhatsNewProvider.kt +++ b/src/main/kotlin/com/github/lppedd/cc/api/WhatsNewProvider.kt @@ -1,7 +1,9 @@ package com.github.lppedd.cc.api -import com.intellij.openapi.extensions.AbstractExtensionPointBean import com.intellij.openapi.extensions.ExtensionPointName +import com.intellij.openapi.extensions.PluginAware +import com.intellij.openapi.extensions.PluginDescriptor +import com.intellij.serviceContainer.LazyExtensionInstance import com.intellij.util.xmlb.annotations.* import org.jetbrains.annotations.ApiStatus.* @@ -29,10 +31,23 @@ internal val WHATS_NEW_EP = ExtensionPointName( */ @Experimental @AvailableSince("0.16.0") -abstract class WhatsNewProvider : AbstractExtensionPointBean() { +abstract class WhatsNewProvider : LazyExtensionInstance(), PluginAware { + lateinit var pluginDescriptor: PluginDescriptor + private set + + @Attribute("implementation") + var implementation: String = "" + @Property(surroundWithTag = false) var files: WhatsNewFiles = WhatsNewFiles() + override fun getImplementationClassName(): String = + implementation + + override fun setPluginDescriptor(pluginDescriptor: PluginDescriptor) { + this.pluginDescriptor = pluginDescriptor + } + /** * The name for the dialog's tab. */ @@ -41,7 +56,7 @@ abstract class WhatsNewProvider : AbstractExtensionPointBean() { /** * States if the "what's new" pages should be displayed at IDE startup, * and thus states if the What's New dialog should be shown. - * Typically the dialog should be shown every plugin update. + * Typically, the dialog should be shown every plugin update. */ abstract fun shouldDisplay(): Boolean