Skip to content

Commit

Permalink
refactor: replace deprecated AbstractExtensionPointBean with LazyExte…
Browse files Browse the repository at this point in the history
…nsionInstance
  • Loading branch information
lppedd committed Aug 2, 2021
1 parent f46e4f0 commit 0e5a351
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/main/kotlin/com/github/lppedd/cc/api/WhatsNewProvider.kt
Original file line number Diff line number Diff line change
@@ -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.*

Expand Down Expand Up @@ -29,10 +31,23 @@ internal val WHATS_NEW_EP = ExtensionPointName<WhatsNewProvider>(
*/
@Experimental
@AvailableSince("0.16.0")
abstract class WhatsNewProvider : AbstractExtensionPointBean() {
abstract class WhatsNewProvider : LazyExtensionInstance<WhatsNewProvider>(), 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.
*/
Expand All @@ -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

Expand Down

0 comments on commit 0e5a351

Please sign in to comment.