public void refresh() {
    onsaveCopyDocumentTo.setSelected(copyBasicToXmp);
    onsaveCopyXmpTo.setSelected(copyXmpToBasic);

    comboBox.setSelectedItem(renameTemplate);

    defaultMetadataPane.fillFromMetadata(defaultMetadata);
    showPreview(renameTemplate);
  }
  public void save() {
    prefs.putBoolean("onsaveCopyXmpTo", copyXmpToBasic);
    prefs.putBoolean("onsaveCopyBasicTo", copyBasicToXmp);
    if (renameTemplate != null && renameTemplate.length() > 0)
      prefs.put("renameTemplate", renameTemplate);
    else prefs.remove("renameTemplate");
    defaultMetadataPane.copyToMetadata(defaultMetadata);
    prefs.put("defaultMetadata", defaultMetadata.toYAML());

    prefs.put("defaultSaveAction", defaultSaveAction);
    if (onSave != null) onSave.run();
  }