Listener for module library changes

已回答

I'need to be able to listen to module library changes to determine when I need to restart some externa process. Is there a way to do this?

1

This is how to do it

 

myProject.getMessageBus().connect(myProject).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
//Here goes your code ;)
}

@Override
public void beforeRootsChange(ModuleRootEvent event) {
System.out.println("WeaveEditorToolingAPI.beforeRootsChange");
}
});
0

Yes, listening for PROJECT_ROOTS topic is the right way to do this.

1

请先登录再写评论。