I was hoping to use the PsiManager.addPsiTreeChangeListener to listen to class creation(or any other PsiFile) events.
The problem is that the childAdded method in the listeners are getting called before i can access it's contents. What this means is that i just can't get any basic information about the created class like it's package.
((PsiJavaFile) event.getChild()).getPackageName() always returns null.
Am i doing something wrong ? Is there any other type of listener i can use to get this done ?