@Override public void removeVirtualFileListener(@NotNull final VirtualFileListener listener) { final VirtualFileListener wrapper = myListenerWrappers.remove(listener); if (wrapper != null) { VirtualFileManager.getInstance().removeVirtualFileListener(wrapper); } }
private static void markDirty(@NotNull VirtualFile file, @NotNull VirtualFileListener listener) { Project project = listenToProjectMap.get(listener); boolean inProject = ProjectRootManager.getInstance(project).getFileIndex().getContentRootForFile(file) != null; LOG.debug(String.format("Changed: %s. In project: %s", file.getPath(), inProject)); if (inProject) { markDirty(project); notifyProjectRefreshIfNecessary(file, project); } }
public static void unregisterProject(@NotNull Project project) { projectStates.remove(project); // Remove the listener for the project. listenToProjectMap.entrySet().stream() .filter(s -> s.getValue() == project) .findFirst() .ifPresent(x -> { VirtualFileListener listener = x.getKey(); listenToProjectMap.remove(listener); LocalFileSystem.getInstance().removeVirtualFileListener(listener); }); }
@Override public void addVirtualFileListener(@NotNull final VirtualFileListener listener) { synchronized (myListenerWrappers) { VirtualFileListener wrapper = new VirtualFileFilteringListener(listener, this); VirtualFileManager.getInstance().addVirtualFileListener(wrapper); myListenerWrappers.put(listener, wrapper); } }
@Override public void removeVirtualFileListener(@NotNull final VirtualFileListener listener) { synchronized (myListenerWrappers) { final VirtualFileListener wrapper = myListenerWrappers.remove(listener); if (wrapper != null) { VirtualFileManager.getInstance().removeVirtualFileListener(wrapper); } } }
@Override public void addVirtualFileListener(@Nonnull final VirtualFileListener listener) { synchronized (myListenerWrappers) { VirtualFileListener wrapper = new VirtualFileFilteringListener(listener, this); VirtualFileManager.getInstance().addVirtualFileListener(wrapper); myListenerWrappers.put(listener, wrapper); } }
@Override public void removeVirtualFileListener(@Nonnull final VirtualFileListener listener) { synchronized (myListenerWrappers) { final VirtualFileListener wrapper = myListenerWrappers.remove(listener); if (wrapper != null) { VirtualFileManager.getInstance().removeVirtualFileListener(wrapper); } } }
public BackgroundTaskByVfsChangeManagerImpl(@Nonnull Project project) { myProject = project; VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileListener() { @Override public void contentsChanged(@Nonnull VirtualFileEvent event) { runTasks(event.getFile()); } }, this); }
@Override public void addVirtualFileListener(@NotNull final VirtualFileListener listener) { VirtualFileListener wrapper = new VirtualFileFilteringListener(listener, this); VirtualFileManager.getInstance().addVirtualFileListener(wrapper); myListenerWrappers.put(listener, wrapper); }
void addTracker( @NotNull String fileUrl, @NotNull VirtualFileListener listener, boolean fromRefreshOnly, @NotNull Disposable parentDisposable);
public static void registerProject(@NotNull Project project) { VirtualFileListener listener = getNewListener(); LocalFileSystem.getInstance().addVirtualFileListener(listener); listenToProjectMap.put(listener, project); }
void addTracker( @Nonnull String fileUrl, @Nonnull VirtualFileListener listener, boolean fromRefreshOnly, @Nonnull Disposable parentDisposable);
public void addVFSListenerAfterLocalHistoryOne(VirtualFileListener virtualFileListener, Disposable disposable) { myEventDispatcher.addVirtualFileListener(virtualFileListener, disposable); }
@Override public void addVirtualFileListener(@NotNull VirtualFileListener virtualFileListener) { }
@Override public void removeVirtualFileListener(@NotNull VirtualFileListener virtualFileListener) { }
@Override public void addVirtualFileListener(@NotNull VirtualFileListener listener) { }
@Override public void addVirtualFileListener(@NotNull VirtualFileListener listener, @NotNull Disposable parentDisposable) { }
@Override public void removeVirtualFileListener(@NotNull VirtualFileListener listener) { }