use of com.intellij.openapi.vfs.newvfs.RefreshSession in project intellij-community by JetBrains.
the class FileRefresher method dispose.
@Override
public void dispose() {
disposed = true;
unwatch();
RefreshSession session = this.session.getAndSet(null);
if (session != null)
RefreshQueue.getInstance().cancelSession(session.getId());
}
use of com.intellij.openapi.vfs.newvfs.RefreshSession in project intellij-community by JetBrains.
the class PlatformVirtualFileManager method doRefresh.
@Override
protected long doRefresh(boolean asynchronous, @Nullable Runnable postAction) {
if (!asynchronous) {
ApplicationManager.getApplication().assertIsDispatchThread();
}
// todo: get an idea how to deliver changes from local FS to jar fs before they go refresh
RefreshSession session = RefreshQueue.getInstance().createSession(asynchronous, true, postAction);
session.addAllFiles(myManagingFS.getRoots());
session.launch();
super.doRefresh(asynchronous, postAction);
return session.getId();
}
use of com.intellij.openapi.vfs.newvfs.RefreshSession in project intellij-community by JetBrains.
the class SaveAndSyncHandlerImpl method maybeRefresh.
public void maybeRefresh(@NotNull ModalityState modalityState) {
if (myBlockSyncOnFrameActivationCount.get() == 0 && mySettings.isSyncOnFrameActivation()) {
RefreshQueue queue = RefreshQueue.getInstance();
queue.cancelSession(myRefreshSessionId);
RefreshSession session = queue.createSession(true, true, null, modalityState);
session.addAllFiles(ManagingFS.getInstance().getLocalRoots());
myRefreshSessionId = session.getId();
session.launch();
LOG.debug("vfs refreshed");
} else if (LOG.isDebugEnabled()) {
LOG.debug("vfs refresh rejected, blocked: " + (myBlockSyncOnFrameActivationCount.get() != 0) + ", isSyncOnFrameActivation: " + mySettings.isSyncOnFrameActivation());
}
}
use of com.intellij.openapi.vfs.newvfs.RefreshSession in project intellij-community by JetBrains.
the class FileRefresher method launch.
private void launch() {
List<VirtualFile> files = this.files;
if (!disposed && !paused && files != null) {
RefreshSession session = RefreshQueue.getInstance().createSession(true, recursive, this::finish);
if (this.session.compareAndSet(null, session)) {
session.addAllFiles(files);
session.launch();
}
}
}
Aggregations