void (@NotNull ActionEvent e) { PsiElement element = parseText(myEditor.getDocument().getText()); setOriginalFiles(element); List<PsiElement> allToParse = new ArrayList<>(); if (element instanceof PsiFile) { allToParse.addAll(((PsiFile)element).getViewProvider().getAllFiles()); } else if (element != null) { allToParse.add(element); } StringBuilder data = new StringBuilder(); for (PsiElement psiElement : allToParse) { data.append(DebugUtil.psiToString(psiElement, myShowWhiteSpacesBox.isSelected(), true)); } CopyPasteManager.getInstance().setContents(new StringSelection(data.toString())); }