use of com.intellij.openapi.fileEditor.ex.FileEditorManagerEx 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);
}
}
use of com.intellij.openapi.fileEditor.ex.FileEditorManagerEx in project intellij-community by JetBrains.
the class CCRenameHandler method invoke.
@Override
public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext) {
PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(dataContext);
assert element != null;
PsiDirectory directory = (PsiDirectory) element;
Course course = StudyTaskManager.getInstance(project).getCourse();
if (course == null) {
return;
}
rename(project, course, directory);
ProjectView.getInstance(project).refresh();
FileEditorManagerEx managerEx = FileEditorManagerEx.getInstanceEx(project);
for (VirtualFile virtualFile : managerEx.getOpenFiles()) {
managerEx.updateFilePresentation(virtualFile);
}
}
Aggregations