public void saveLibrary() {
        final String libraryFilePath = dlgLibrary.open();
        if (libraryFilePath != null) {
            Yaml yaml = new Yaml();
            BufferedWriter stream = null;
            try {
                stream = new BufferedWriter(new FileWriter(libraryFilePath));
                stream.write(yaml.dump(library));
                stream.close();
            } catch (FileNotFoundException ex) {
                showMessage(Messages.ERROR_FILE_NOT_FOUND + libraryFilePath, "Error");
            } catch (IOException ex) {
                showMessage(Messages.ERROR_CANT_WRITE_TO_FILE + libraryFilePath, "Error");
            }
            String message = Messages.FILE_SAVED + libraryFilePath;
            status(message);
        } else {
            status(Messages.LIBRARY_FILE_NOT_SELECTED);
        }
    }