void (@NotNull DropContext context) { final PsiElement targetElement = context.targetElement(); final PsiElement @Nullable [] sources = getPsiElements(context); if (targetElement == null || sources == null) return; if (DumbService.isDumb(myProject)) { DumbModeBlockedFunctionalityCollector.INSTANCE.logFunctionalityBlocked(myProject, DumbModeBlockedFunctionality.ProjectView); Messages.showMessageDialog(myProject, LangBundle.message("dialog.message.copy.refactoring.available.while.indexing.in.progress"), LangBundle.message("dialog.title.indexing"), null); return; } final PsiDirectory psiDirectory; if (targetElement instanceof PsiDirectoryContainer directoryContainer) { final PsiDirectory[] psiDirectories = directoryContainer.getDirectories(); psiDirectory = psiDirectories.length != 0 ? psiDirectories[0] : null; } else if (targetElement instanceof PsiDirectory) { psiDirectory = (PsiDirectory)targetElement; } else { final PsiFile containingFile = targetElement.getContainingFile(); LOG.assertTrue(containingFile != null, targetElement); psiDirectory = containingFile.getContainingDirectory(); } CopyHandler.doCopy(sources, psiDirectory); }