SelectInContext (AnActionEvent event) { SelectInContext result = event.getData(SelectInContext.DATA_KEY); if (result != null) { return result; } Project project = event.getProject(); FileEditor editor = event.getData(PlatformCoreDataKeys.FILE_EDITOR); VirtualFile virtualFile = event.getData(CommonDataKeys.VIRTUAL_FILE); result = createEditorContext(project, editor, virtualFile); if (result != null) { return result; } JComponent sourceComponent = getEventComponent(event); if (sourceComponent == null) { return null; } result = createPsiContext(event); if (result != null) { return result; } Navigatable descriptor = event.getData(CommonDataKeys.NAVIGATABLE); result = descriptor instanceof OpenFileDescriptor ? createDescriptorContext((OpenFileDescriptor)descriptor) : null; if (result != null) { return result; } if (virtualFile != null && project != null) { return new FileSelectInContext(project, virtualFile, null); } return null; }