use of com.intellij.openapi.roots.ModuleRootListener in project intellij-community by JetBrains.
the class VcsEventWatcher method projectOpened.
@Override
public void projectOpened() {
MessageBusConnection connection = myProject.getMessageBus().connect(myProject);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
ApplicationManager.getApplication().invokeLater(() -> VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(), ModalityState.NON_MODAL, myProject.getDisposed());
}
});
WolfTheProblemSolver.getInstance(myProject).addProblemListener(new MyProblemListener(), myProject);
}
use of com.intellij.openapi.roots.ModuleRootListener in project intellij-community by JetBrains.
the class DirectoryIndexImpl method subscribeToFileChanges.
protected void subscribeToFileChanges() {
myConnection.subscribe(FileTypeManager.TOPIC, new FileTypeListener() {
@Override
public void fileTypesChanged(@NotNull FileTypeEvent event) {
myRootIndex = null;
}
});
myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
myRootIndex = null;
}
});
myConnection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() {
@Override
public void after(@NotNull List<? extends VFileEvent> events) {
RootIndex rootIndex = myRootIndex;
if (rootIndex != null && rootIndex.resetOnEvents(events)) {
myRootIndex = null;
}
}
});
}
use of com.intellij.openapi.roots.ModuleRootListener in project intellij-community by JetBrains.
the class MiscImportingTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myProject.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void beforeRootsChange(ModuleRootEvent event) {
beforeRootsChangedCount++;
}
@Override
public void rootsChanged(ModuleRootEvent event) {
rootsChangedCount++;
}
});
}
Aggregations