use of com.intellij.openapi.vfs.VirtualFileListener in project intellij-community by JetBrains.
the class NewVirtualFileSystem method addVirtualFileListener.
@Override
public void addVirtualFileListener(@NotNull final VirtualFileListener listener) {
VirtualFileListener wrapper = new VirtualFileFilteringListener(listener, this);
VirtualFileManager.getInstance().addVirtualFileListener(wrapper);
myListenerWrappers.put(listener, wrapper);
}
use of com.intellij.openapi.vfs.VirtualFileListener in project intellij-plugins by JetBrains.
the class PhoneGapStartupActivity method runActivity.
@Override
public void runActivity(@NotNull Project project) {
StartupManager.getInstance(project).runWhenProjectIsInitialized(() -> {
if (PhoneGapUtil.isPhoneGapProject(project)) {
if (PhoneGapSettings.getInstance().isExcludePlatformFolder()) {
excludeWorkingDirectories(project);
}
PhoneGapExecutableChecker.check(project);
}
});
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileListener() {
@Override
public void fileCreated(@NotNull VirtualFileEvent event) {
if (!isProcess(event)) {
return;
}
updateModuleExcludeByFSEvent(project, event, ContainerUtil.newHashSet(), ContainerUtil.newHashSet(getExcludedFolderNames(event)));
}
@Override
public void beforeFileDeletion(@NotNull VirtualFileEvent event) {
if (!isProcess(event)) {
return;
}
updateModuleExcludeByFSEvent(project, event, getExcludedFolderNames(event), ContainerUtil.newHashSet());
}
private boolean isProcess(@NotNull VirtualFileEvent event) {
return shouldExcludeDirectory(event) && PhoneGapUtil.isPhoneGapProject(project) && PhoneGapSettings.getInstance().isExcludePlatformFolder();
}
}, project);
}
Aggregations