mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
default indicator in separate util method
This commit is contained in:
@@ -20,7 +20,6 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.util.ProgressIndicatorBase;
|
||||
import com.intellij.openapi.progress.util.ProgressIndicatorUtils;
|
||||
import com.intellij.openapi.progress.util.ReadTask;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
@@ -93,7 +92,7 @@ public abstract class DefaultMessageHandler implements BuilderMessageHandler {
|
||||
protected abstract void handleBuildEvent(UUID sessionId, CmdlineRemoteProto.Message.BuilderMessage.BuildEvent event);
|
||||
|
||||
private void handleConstantSearchTask(final Channel channel, final UUID sessionId, final CmdlineRemoteProto.Message.BuilderMessage.ConstantSearchTask task) {
|
||||
ProgressIndicatorUtils.scheduleWithWriteActionPriority(new ProgressIndicatorBase(), myTaskExecutor, new ReadTask() {
|
||||
ProgressIndicatorUtils.scheduleWithWriteActionPriority(myTaskExecutor, new ReadTask() {
|
||||
@Override
|
||||
public Continuation runBackgroundProcess(@NotNull ProgressIndicator indicator) throws ProcessCanceledException {
|
||||
return DumbService.getInstance(myProject).runReadActionInSmartMode(new Computable<Continuation>() {
|
||||
|
||||
+4
@@ -66,6 +66,10 @@ public class ProgressIndicatorUtils {
|
||||
scheduleWithWriteActionPriority(progressIndicator, PooledThreadExecutor.INSTANCE, readTask);
|
||||
}
|
||||
|
||||
public static void scheduleWithWriteActionPriority(@NotNull Executor executor, @NotNull ReadTask task) {
|
||||
scheduleWithWriteActionPriority(new ProgressIndicatorBase(), executor, task);
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as {@link #runInReadActionWithWriteActionPriority(Runnable)}, optionally allowing to pass a {@link ProgressIndicatorUtils}
|
||||
* instance, which can be used to cancel action externally.
|
||||
|
||||
+1
-4
@@ -26,7 +26,6 @@ import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.util.ProgressIndicatorBase;
|
||||
import com.intellij.openapi.progress.util.ProgressIndicatorUtils;
|
||||
import com.intellij.openapi.progress.util.ReadTask;
|
||||
import com.intellij.openapi.project.DumbAwareRunnable;
|
||||
@@ -296,9 +295,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent {
|
||||
return !myProject.isDisposed() && orderSnapshot.equals(takeOrderSnapshot());
|
||||
}
|
||||
};
|
||||
GuiUtils.invokeLaterIfNeeded(
|
||||
() -> ProgressIndicatorUtils.scheduleWithWriteActionPriority(new ProgressIndicatorBase(), ourExecutor, task),
|
||||
ModalityState.NON_MODAL);
|
||||
GuiUtils.invokeLaterIfNeeded(() -> ProgressIndicatorUtils.scheduleWithWriteActionPriority(ourExecutor, task), ModalityState.NON_MODAL);
|
||||
}
|
||||
|
||||
private LinkedHashSet<Pair<Object, SyncAction>> takeOrderSnapshot() {
|
||||
|
||||
Reference in New Issue
Block a user