本文整理汇总了Java中com.intellij.openapi.vfs.VirtualFileListener类的典型用法代码示例。如果您正苦于以下问题:Java VirtualFileListener类的具体用法?Java VirtualFileListener怎么用?Java VirtualFileListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VirtualFileListener类属于com.intellij.openapi.vfs包,在下文中一共展示了VirtualFileListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: markDirty
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
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);
}
}
示例2: removeVirtualFileListener
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
@Override
public void removeVirtualFileListener(@NotNull final VirtualFileListener listener) {
final VirtualFileListener wrapper = myListenerWrappers.remove(listener);
if (wrapper != null) {
VirtualFileManager.getInstance().removeVirtualFileListener(wrapper);
}
}
示例3: unregisterProject
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
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);
});
}
示例4: addVirtualFileListener
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
@Override
public void addVirtualFileListener(@NotNull final VirtualFileListener listener) {
synchronized (myListenerWrappers) {
VirtualFileListener wrapper = new VirtualFileFilteringListener(listener, this);
VirtualFileManager.getInstance().addVirtualFileListener(wrapper);
myListenerWrappers.put(listener, wrapper);
}
}
示例5: removeVirtualFileListener
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
@Override
public void removeVirtualFileListener(@NotNull final VirtualFileListener listener) {
synchronized (myListenerWrappers) {
final VirtualFileListener wrapper = myListenerWrappers.remove(listener);
if (wrapper != null) {
VirtualFileManager.getInstance().removeVirtualFileListener(wrapper);
}
}
}
示例6: addVirtualFileListener
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
@Override
public void addVirtualFileListener(@Nonnull final VirtualFileListener listener) {
synchronized (myListenerWrappers) {
VirtualFileListener wrapper = new VirtualFileFilteringListener(listener, this);
VirtualFileManager.getInstance().addVirtualFileListener(wrapper);
myListenerWrappers.put(listener, wrapper);
}
}
示例7: removeVirtualFileListener
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
@Override
public void removeVirtualFileListener(@Nonnull final VirtualFileListener listener) {
synchronized (myListenerWrappers) {
final VirtualFileListener wrapper = myListenerWrappers.remove(listener);
if (wrapper != null) {
VirtualFileManager.getInstance().removeVirtualFileListener(wrapper);
}
}
}
示例8: BackgroundTaskByVfsChangeManagerImpl
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
public BackgroundTaskByVfsChangeManagerImpl(@Nonnull Project project) {
myProject = project;
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileListener() {
@Override
public void contentsChanged(@Nonnull VirtualFileEvent event) {
runTasks(event.getFile());
}
}, this);
}
示例9: addVirtualFileListener
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
@Override
public void addVirtualFileListener(@NotNull final VirtualFileListener listener) {
VirtualFileListener wrapper = new VirtualFileFilteringListener(listener, this);
VirtualFileManager.getInstance().addVirtualFileListener(wrapper);
myListenerWrappers.put(listener, wrapper);
}
示例10: addTracker
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
void addTracker(
@NotNull String fileUrl,
@NotNull VirtualFileListener listener,
boolean fromRefreshOnly,
@NotNull Disposable parentDisposable);
示例11: registerProject
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
public static void registerProject(@NotNull Project project) {
VirtualFileListener listener = getNewListener();
LocalFileSystem.getInstance().addVirtualFileListener(listener);
listenToProjectMap.put(listener, project);
}
示例12: addTracker
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
void addTracker(
@Nonnull String fileUrl,
@Nonnull VirtualFileListener listener,
boolean fromRefreshOnly,
@Nonnull Disposable parentDisposable);
示例13: addVFSListenerAfterLocalHistoryOne
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
public void addVFSListenerAfterLocalHistoryOne(VirtualFileListener virtualFileListener, Disposable disposable) {
myEventDispatcher.addVirtualFileListener(virtualFileListener, disposable);
}
示例14: addVirtualFileListener
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
@Override
public void addVirtualFileListener(@NotNull VirtualFileListener virtualFileListener) {
}
示例15: removeVirtualFileListener
import com.intellij.openapi.vfs.VirtualFileListener; //导入依赖的package包/类
@Override
public void removeVirtualFileListener(@NotNull VirtualFileListener virtualFileListener) {
}