use of com.intellij.openapi.project.DumbServiceImpl 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);
}
}
use of com.intellij.openapi.project.DumbServiceImpl in project intellij-community by JetBrains.
the class FormOpeningTest method testOpenInDumbMode.
public void testOpenInDumbMode() throws Exception {
FileEditorManagerEx editorManager = FileEditorManagerEx.getInstanceEx(getProject());
VirtualFile file = myFixture.copyFileToProject("TestBorder.form");
DumbServiceImpl dumbService = (DumbServiceImpl) DumbService.getInstance(getProject());
dumbService.setDumb(true);
try {
FileEditor[] editors = editorManager.openFile(file, true);
assertEquals(1, editors.length);
assertInstanceOf(editors[0], UIFormEditor.class);
JComponent component = getEditorComponent();
assertInstanceOf(component, DumbUnawareHider.class);
assertEquals(2, component.getComponentCount());
Component editorComponent = component.getComponents()[0];
assertInstanceOf(editorComponent, GuiEditor.class);
assertFalse(editorComponent.isVisible());
dumbService.setDumb(false);
assertTrue(editorComponent.isVisible());
} finally {
dumbService.setDumb(false);
}
}
Aggregations