@Override
	public void actionPerformed(ActionEvent e) {

		// TODO:
		// We first need to update the text in the DocumentManager
		// and THEN call save on it.

		boolean save = false;

		if (documentManager.validate(tabManager.getText())) {
			save = true;
		} else {
			int choice = JOptionPane
					.showConfirmDialog(
							null,
							"The file you are trying to save"
									+ " is not well-formed HTML. Would you like to save anyway?",
							"Well-formed check failed",
							JOptionPane.YES_NO_OPTION);
			if (choice == JOptionPane.YES_OPTION) {
				save = true;
			} else {
				save = false;
			}
		}

		if (save) {
			try {
				documentManager.save(tabManager.getText());
			} catch (IOException e1) {
				e1.printStackTrace();
				JOptionPane.showMessageDialog(null, "An error occurred while"
						+ " saving the file.");
			}
		}
	}