diff --git a/CHANGELOG.md b/CHANGELOG.md index 956e7ea..7531c94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ - Upgrade Gradle Wrapper to `8.1.1` - GitHub Actions — switch to Java 17 +### Fixed +- Example code - Fixed deprecated usage of `ContentFactory` in `MyToolWindowFactory` Jakub Chrzanowski A minute ago d454bc09 +- Example code - Migrate from the deprecated `FrameStateListener.onFrameActivated()` to `ApplicationActivationListener.applicationActivated(IdeFrame)` + ## [1.6.0] - 2023-04-13 ### Added diff --git a/README.md b/README.md index 391b637..b77529f 100644 --- a/README.md +++ b/README.md @@ -218,13 +218,13 @@ Therefore, the template contains only the following files: ``` . -├── MyBundle.kt Bundle class providing access to the resources messages +├── MyBundle.kt Bundle class providing access to the resources messages ├── listeners -│ └── MyFrameStateListener.kt Frame state listener — detects when IDE frame is opened/closed +│ └── MyApplicationActivationListener.kt Application activation listener — detects when IDE frame is activated ├── services -│ └── MyProjectService.kt Project level service +│ └── MyProjectService.kt Project level service ├── toolWindow -│ └── MyToolWindowFactory.kt Tool window factory — creates tool window content +│ └── MyToolWindowFactory.kt Tool window factory — creates tool window content └ ``` diff --git a/src/main/kotlin/org/jetbrains/plugins/template/listeners/MyFrameStateListener.kt b/src/main/kotlin/org/jetbrains/plugins/template/listeners/MyApplicationActivationListener.kt similarity index 50% rename from src/main/kotlin/org/jetbrains/plugins/template/listeners/MyFrameStateListener.kt rename to src/main/kotlin/org/jetbrains/plugins/template/listeners/MyApplicationActivationListener.kt index 618a15d..7f03dd4 100644 --- a/src/main/kotlin/org/jetbrains/plugins/template/listeners/MyFrameStateListener.kt +++ b/src/main/kotlin/org/jetbrains/plugins/template/listeners/MyApplicationActivationListener.kt @@ -1,11 +1,12 @@ package org.jetbrains.plugins.template.listeners -import com.intellij.ide.FrameStateListener +import com.intellij.openapi.application.ApplicationActivationListener import com.intellij.openapi.diagnostic.thisLogger +import com.intellij.openapi.wm.IdeFrame -internal class MyFrameStateListener : FrameStateListener { +internal class MyApplicationActivationListener : ApplicationActivationListener { - override fun onFrameActivated() { + override fun applicationActivated(ideFrame: IdeFrame) { thisLogger().warn("Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`.") } } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 435701b..a812002 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -13,6 +13,6 @@ - +