Search in sources :

Example 1 with DumbServiceImpl

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);
    }
}
Also used : DumbModeTask(com.intellij.openapi.project.DumbModeTask) DumbServiceImpl(com.intellij.openapi.project.DumbServiceImpl)

Example 2 with DumbServiceImpl

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);
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) FileEditor(com.intellij.openapi.fileEditor.FileEditor) DumbServiceImpl(com.intellij.openapi.project.DumbServiceImpl) FileEditorManagerEx(com.intellij.openapi.fileEditor.ex.FileEditorManagerEx)

Aggregations

DumbServiceImpl (com.intellij.openapi.project.DumbServiceImpl)2 FileEditor (com.intellij.openapi.fileEditor.FileEditor)1 FileEditorManagerEx (com.intellij.openapi.fileEditor.ex.FileEditorManagerEx)1 DumbModeTask (com.intellij.openapi.project.DumbModeTask)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1