Object (@NotNull @NonNls String dataId) { if (CommonDataKeys.PROJECT.is(dataId)) { return myProject; } else if (CommonDataKeys.EDITOR.is(dataId) || OpenFileDescriptor.NAVIGATE_IN_EDITOR.is(dataId)) { if (myProject == null || myProject.isDisposed()) { return null; } return FileEditorManager.getInstance(myProject).getSelectedTextEditor(); } else { Editor editor = (Editor)getData(CommonDataKeys.EDITOR.getName()); if (editor != null) { if (PlatformCoreDataKeys.FILE_EDITOR.is(dataId)) { return TextEditorProvider.getInstance().getTextEditor(editor); } else { FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(myProject); return manager.getData(dataId, editor, editor.getCaretModel().getCurrentCaret()); } } if (LangDataKeys.IDE_VIEW.is(dataId)) { VirtualFile[] contentRoots = ProjectRootManager.getInstance(myProject).getContentRoots(); if (contentRoots.length > 0) { final PsiDirectory psiDirectory = PsiManager.getInstance(myProject).findDirectory(contentRoots[0]); return new IdeView() { @Override public PsiDirectory @NotNull [] getDirectories() { return new PsiDirectory[] {psiDirectory}; } @Override public PsiDirectory getOrChooseDirectory() { return psiDirectory; } }; } } return null; } }