Is there a listener to listen when IDEA starts ?

Answered

Do we have any listener that gives a callback for when the IDE starts?

I found com.intellij.openapi.project.ProjectManagerListener that gives a callback for when the user opens project.

0
2 comments

For opening the projects, you can implement the

com.intellij.openapi.startup.StartupActivity.DumbAware#runActivity

and add a

<postStartupActivity id="<provide your ID>" implementation="<the class that implements com.intellij.openapi.startup.StartupActivity.DumbAware>"/>

inside the <extensions> on the META-INF/plugin.xml

 

but if you want to execute something after loading the project and after the indexing finishes, you can implement the

com.intellij.openapi.project.ProjectManagerListener#projectOpened

and add it inside the <projectListeners>

<listener class="<class that implements ProjectManagerListener>"
topic="com.intellij.openapi.project.ProjectManagerListener"/>

of META-INF/plugin.xml

 

 

 

0

Please sign in to leave a comment.