use of com.intellij.openapi.project.DumbModeTask in project intellij-community by JetBrains.
the class ToggleDumbModeAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
if (myDumb) {
myDumb = false;
} else {
myDumb = true;
final Project project = e.getProject();
if (project == null)
return;
DumbServiceImpl.getInstance(project).queueTask(new DumbModeTask() {
@Override
public void performInDumbMode(@NotNull ProgressIndicator indicator) {
while (myDumb) {
indicator.checkCanceled();
TimeoutUtil.sleep(100);
}
}
});
}
}
use of com.intellij.openapi.project.DumbModeTask in project intellij-community by JetBrains.
the class ProjectRootManagerComponent method doUpdateOnRefresh.
private void doUpdateOnRefresh() {
if (ApplicationManager.getApplication().isUnitTestMode() && (!myStartupActivityPerformed || myProject.isDisposed())) {
// in test mode suppress addition to a queue unless project is properly initialized
return;
}
if (myProject.isDefault()) {
return;
}
if (myDoLogCachesUpdate)
LOG.debug("refresh");
DumbServiceImpl dumbService = DumbServiceImpl.getInstance(myProject);
DumbModeTask task = FileBasedIndexProjectHandler.createChangedFilesIndexingTask(myProject);
if (task != null) {
dumbService.queueTask(task);
}
}
Aggregations