How to listen to the library updates on Module?

Answered

I wanted to listen if user is adding a jar file to the module or not. Can we do it using PsiTreeChangeListener?

4 comments
Comment actions Permalink

No, you need to use com.intellij.ProjectTopics#PROJECT_ROOTS instead.

0
Comment actions Permalink

How to use this class, how it works.. Could you please describe. There is no javadoc for this.

0
Comment actions Permalink

Just call project.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, listener). See Javadocs of MessageBus and Topic for more details.

1

Please sign in to leave a comment.