label.keep_files = Deleting old backup files
label.keep_all_backup_files = Do not delete old backup files
label.keep_only_this_number_of_backup_files = Keep only this number of most recent backup files
-label.autodelete_old_backup_files = Autodelete old backup files:
+label.autodelete_old_backup_files = Auto-delete old backup files:
label.always_ask = Always ask
label.auto_delete = Automatically delete
label.filename = filename
label.single_file = Single backup
label.keep_all_versions = Keep all versions
label.rolled_backups = Rolled backup files
+label.customise_description = Select Customise, make changes, and click on OK to save your own custom scheme
+label.custom_description = Your own saved scheme
+label.default_description = Keep the last three versions of the file
+label.single_file_description = Keep the last version of the file
+label.keep_all_versions_description = Keep all previous versions of the file
+label.rolled_backups_description = Keep the last nine versions of the file from _bak.1 (newest) to _bak.9 (oldest)
label.previously_saved_scheme = Previously saved scheme
label.no_backup_files = NO BACKUP FILES
label.include_backup_files = Include backup files
label.single_file = Solo uno respaldo
label.keep_all_versions = Mantener todas las versiones
label.rolled_backups = Ciclos respaldos
+# TODO: Translate these _description s
+label.customise_description = Seleccione Personalizar, haga cambios y haga clic en OK para guardar su propio esquema personalizado
+label.custom_description = Tu propio esquema guardado
+label.default_description = Conserve las últimas tres versiones del archivo
+label.single_file_description = Conserve la última versión del archivo
+label.keep_all_versions_description = Mantener todas las versiones anteriores del archivo
+label.rolled_backups_description = Mantenga las últimas nueve versiones del archivo desde _bak.1 (más reciente) a _bak.9 (más antigua)
label.previously_saved_scheme = Esquema previamente guardado
label.no_backup_files = NO ARCHIVOS DE RESPALDOS
label.include_backup_files = Incluir archivos de respaldos
*/
package jalview.gui;
+import jalview.io.IntKeyStringValueEntry;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
}
/**
+ * A helper method to build a drop-down choice of values, with tooltips for the
+ * entries
+ *
+ * @param entries
+ * @param tooltips
+ */
+ public static JComboBox<IntKeyStringValueEntry> buildIntKeyStringValueComboWithTooltips(
+ List<IntKeyStringValueEntry> entries, List<String> tooltips)
+ {
+ JComboBox<IntKeyStringValueEntry> combo = new JComboBox<>();
+ final ComboBoxTooltipRenderer renderer = new ComboBoxTooltipRenderer();
+ combo.setRenderer(renderer);
+ for (IntKeyStringValueEntry attName : entries)
+ {
+ combo.addItem(attName);
+ }
+ renderer.setTooltips(tooltips);
+ final MouseAdapter mouseListener = new MouseAdapter()
+ {
+ @Override
+ public void mouseEntered(MouseEvent e)
+ {
+ int j = combo.getSelectedIndex();
+ if (j > -1)
+ {
+ combo.setToolTipText(tooltips.get(j));
+ }
+ }
+
+ @Override
+ public void mouseExited(MouseEvent e)
+ {
+ combo.setToolTipText(null);
+ }
+ };
+ for (Component c : combo.getComponents())
+ {
+ c.addMouseListener(mouseListener);
+ }
+ return combo;
+ }
+
+ /**
* Adds a titled border to the component in the default font and position (top
* left), optionally witht italic text
*
new IntKeyStringValueEntry(BACKUPFILESSCHEMECUSTOM,
MessageManager.getString("label.custom")) };
+ public static final String[] backupfilesPresetEntryDescriptions = {
+ MessageManager.getString("label.default_description"),
+ MessageManager.getString("label.single_file_description"),
+ MessageManager.getString("label.keep_all_versions_description"),
+ MessageManager.getString("label.rolled_backups_description"),
+ MessageManager.getString("label.custom_description") };
+
public static final Map<Integer, BackupFilesPresetEntry> backupfilesPresetEntriesValues = new HashMap<>()
{
/**
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.util.Arrays;
+import java.util.List;
import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
presetsComboLabel = new JLabel(title + ":");
presetsPanel.add(presetsComboLabel, gbc);
+ List<IntKeyStringValueEntry> entries = Arrays
+ .asList(BackupFilesPresetEntry.backupfilesPresetEntries);
+ List<String> tooltips = Arrays.asList(
+ BackupFilesPresetEntry.backupfilesPresetEntryDescriptions);
+ backupfilesPresetsCombo = JvSwingUtils
+ .buildIntKeyStringValueComboWithTooltips(entries, tooltips);
+ /*
for (int i = 0; i < BackupFilesPresetEntry.backupfilesPresetEntries.length; i++)
{
backupfilesPresetsCombo
.addItem(BackupFilesPresetEntry.backupfilesPresetEntries[i]);
}
+ */
backupfilesPresetsCombo.addActionListener(new ActionListener()
{
backupfilesCustomOptionsSetEnabled();
}
});
+ customiseCheckbox.setToolTipText(
+ MessageManager.getString("label.customise_description"));
// customise checkbox
gbc.gridx = 0;