protected void startEventPropagation() { Application application = ApplicationManager.getApplication(); if (application == null) { return; } application.getMessageBus().connect().subscribe( VirtualFileManager.VFS_CHANGES, new BulkVirtualFileListenerAdapter(myEventDispatcher.getMulticaster(), this)); }
@Override public void after(@NotNull List<? extends VFileEvent> events) { myContentlessIndicesUpdateQueue.ensureUpToDate(); for (VFileEvent event : events) { BulkVirtualFileListenerAdapter.fireAfter(this, event); } myContentlessIndicesUpdateQueue.signalUpdateEnd(); }
@Override public void after(@NotNull List<? extends VFileEvent> events) { if (myBatchChangePlanned) { myBatchChangePlanned = false; long started = System.currentTimeMillis(); doInitialize(); LOG.info("Rebuilt indexstate for " + (System.currentTimeMillis() - started)); } else { for (VFileEvent event : events) { BulkVirtualFileListenerAdapter.fireAfter(this, event); } } }
public PsiVFSListener(StartupManager startupManager, FileTypeManager fileTypeManager, PsiManager psiManager, ProjectRootManager projectRootManager) { myFileTypeManager = fileTypeManager; myProjectRootManager = projectRootManager; myProjectFileIndex = myProjectRootManager.getFileIndex(); myManager = (PsiManagerImpl) psiManager; myFileManager = (FileManagerImpl) myManager.getFileManager(); myConnection = psiManager.getProject().getMessageBus().connect(psiManager.getProject()); startupManager.registerPreStartupActivity(new Runnable() { @Override public void run() { myConnection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkVirtualFileListenerAdapter(PsiVFSListener.this)); myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new MyModuleRootListener()); myConnection.subscribe(FileTypeManager.TOPIC, new FileTypeListener.Adapter() { @Override public void fileTypesChanged(FileTypeEvent e) { myFileManager.processFileTypesChanged(); } }); myConnection.subscribe(AppTopics.FILE_DOCUMENT_SYNC, new MyFileDocumentManagerAdapter()); myFileManager.markInitialized(); } }); }
@Override public void before(@Nonnull List<? extends VFileEvent> events) { myGateway.runWithVfsEventsDispatchContext(events, true, () -> { for (VFileEvent event : events) { BulkVirtualFileListenerAdapter.fireBefore(myVfsEventsDispatcher.getMulticaster(), event); } }); }
@Override public void after(@Nonnull List<? extends VFileEvent> events) { myGateway.runWithVfsEventsDispatchContext(events, false, () -> { for (VFileEvent event : events) { BulkVirtualFileListenerAdapter.fireAfter(myVfsEventsDispatcher.getMulticaster(), event); } }); }
public ContentEntryFileListener(Application application, ProjectManager projectManager) { application.getMessageBus().connect().subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() { @Override public void before(@Nonnull List<? extends VFileEvent> events) { for (Project project : projectManager.getOpenProjects()) { new BulkVirtualFileListenerAdapter(new Listener(project), LocalFileSystem.getInstance()).before(events); } } }); }
@Override public void before(@Nonnull List<? extends VFileEvent> events) { for (VFileEvent event : events) { BulkVirtualFileListenerAdapter.fireBefore(this, event); } }
@Override public void after(@Nonnull List<? extends VFileEvent> events) { for (VFileEvent event : events) { BulkVirtualFileListenerAdapter.fireAfter(this, event); } }