void (@NotNull AnActionEvent e) { final Editor editor = CommonDataKeys.EDITOR.getData(DataManager.getInstance().getDataContext(myConsole.getComponent())); if (editor != null) { final String extension = "xml"; // TODO: get from output type final VirtualFile file = new LightVirtualFile("XSLT Output." + extension, editor.getDocument().getText()) { @NotNull @Override public Charset getCharset() { return StandardCharsets.UTF_8; } }; FileEditorManager.getInstance(e.getProject()).openFile(file, true); } }