Replacement of ProjectManagerListener projectOpened()

Answered

Hello,

I've recently noticed that the projectOpened Method of the ProjectManagerListener is marked as deprecated and scheduled to be deleted but i can't find a replacement method anywhere. So how can i execute code when a project is opened in the future? 

 

0
4 comments

Hi Daniel,

Did you check the page linked in the ProjectManagerListener.projectOpened Javadoc?

https://plugins.jetbrains.com/docs/intellij/plugin-components.html#project-open

0

yes i did and all interfaces linked (startupActivitiy) there are also either deprecated or obsolete

0

Not sure what you mean by that.

Quote from above page for 2023.1 and later
> Using Kotlin, implement ProjectActivity and register in com.intellij.postStartupActivity extension point.

 

Otherwise, you can use the alternatives listed on the other tab. Obsolete API is not a problem per se assuming you can't migrate to the alternative above (yet).

0

ProjectActivity is not deprecated, but it requires Kotlin. If you can't use Kotlin, consider using StartupActivity, which is obsolete (not deprecated). Obsolete API may be subject to deprecation in the future, but can be used now if there are no alternatives.

0

Please sign in to leave a comment.