mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
Real refresh progress not needed in tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,12 +15,16 @@
|
||||
*/
|
||||
package com.intellij.openapi.vfs.newvfs;
|
||||
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.progress.EmptyProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.util.ProgressIndicatorBase;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.openapi.wm.ex.StatusBarEx;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -28,9 +32,20 @@ import javax.swing.*;
|
||||
* @author max
|
||||
*/
|
||||
public class RefreshProgress extends ProgressIndicatorBase {
|
||||
@NotNull
|
||||
public static ProgressIndicator create(@NotNull String message) {
|
||||
Application app = ApplicationManager.getApplication();
|
||||
if (app == null || app.isUnitTestMode()) {
|
||||
return new EmptyProgressIndicator();
|
||||
}
|
||||
else {
|
||||
return new RefreshProgress(message);
|
||||
}
|
||||
}
|
||||
|
||||
private final String myMessage;
|
||||
|
||||
public RefreshProgress(final String message) {
|
||||
private RefreshProgress(@NotNull String message) {
|
||||
myMessage = message;
|
||||
}
|
||||
|
||||
@@ -59,7 +74,6 @@ public class RefreshProgress extends ProgressIndicatorBase {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,7 +40,7 @@ public class RefreshQueueImpl extends RefreshQueue {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vfs.newvfs.RefreshQueueImpl");
|
||||
|
||||
private final ExecutorService myQueue = ConcurrencyUtil.newSingleThreadExecutor("FS Synchronizer");
|
||||
private final ProgressIndicator myRefreshIndicator = new RefreshProgress(VfsBundle.message("file.synchronize.progress"));
|
||||
private final ProgressIndicator myRefreshIndicator = RefreshProgress.create(VfsBundle.message("file.synchronize.progress"));
|
||||
private final TLongObjectHashMap<RefreshSession> mySessions = new TLongObjectHashMap<RefreshSession>();
|
||||
|
||||
public void execute(@NotNull RefreshSessionImpl session) {
|
||||
|
||||
Reference in New Issue
Block a user