void (final PsiElement element) { final boolean isDirectory = element instanceof PsiDirectory; if (!isDirectory) { EditorHelper.openInEditor(element); } ApplicationManager.getApplication().invokeLater(() -> { myBuilder.selectElement(element, PsiUtilCore.getVirtualFile(element)); if (!isDirectory) { ApplicationManager.getApplication().invokeLater(() -> { if (myMoveFocus) { ToolWindowManager.getInstance(myProject).activateEditorComponent(); } }); } }, ModalityState.nonModal()); }