Object (@NotNull @NonNls String dataId) { if (myProject.isDisposed()) { throw new RuntimeException("TestDataProvider is already disposed for " + myProject + "\n" + "If you closed a project in test, please reset TestApplicationManager.setDataProvider."); } if (CommonDataKeys.PROJECT.is(dataId)) { return myProject; } FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(myProject); if (CommonDataKeys.EDITOR.is(dataId) || OpenFileDescriptor.NAVIGATE_IN_EDITOR.is(dataId)) { return manager instanceof FileEditorManagerImpl ? ((FileEditorManagerImpl)manager).getSelectedTextEditor(true) : manager.getSelectedTextEditor(); } else if (PlatformCoreDataKeys.FILE_EDITOR.is(dataId)) { Editor editor = manager.getSelectedTextEditor(); return editor == null ? null : TextEditorProvider.getInstance().getTextEditor(editor); } else { Editor editor = CommonDataKeys.EDITOR.getData(this); if (editor != null) { Object managerData = manager.getData(dataId, editor, editor.getCaretModel().getCurrentCaret()); if (managerData != null) { return managerData; } if (!(editor instanceof ImaginaryEditor)) { JComponent component = editor.getContentComponent(); if (component instanceof EditorComponentImpl) { Object editorComponentData = ((EditorComponentImpl)component).getData(dataId); if (editorComponentData != null) { return editorComponentData; } } } } if (myWithRules) { return DataManager.getInstance().getCustomizedData(dataId, EMPTY_CONTEXT, myDelegateWithoutRules); } return null; } }