public void saveDocumentAs()  {

            view.selectHtmlTab();
            JFileChooser jFileChooser = new JFileChooser();
            jFileChooser.setFileFilter(new HTMLFileFilter());
            JOptionPane.showMessageDialog(view.getContentPane(), "Make your choice...", "Save File", JOptionPane.INFORMATION_MESSAGE);
            // Если пользователь подтвердит выбор файла
            if (jFileChooser.showSaveDialog(view) == JFileChooser.APPROVE_OPTION) {
                currentFile = jFileChooser.getSelectedFile();
                view.setTitle(currentFile.getName());

                FileWriter fileWriter = null;

                try {
                    fileWriter = new FileWriter(currentFile);
                    new HTMLEditorKit().write(fileWriter, document, 0, document.getLength());
                    fileWriter.close();
                } catch (IOException | BadLocationException e) {
                    ExceptionHandler.log(e);
                }
            }
    }