+ private JPanel initBackupsTabPresetsPanel()
+ {
+
+ String title = MessageManager.getString("label.schemes");
+
+ presetsPanel.setLayout(new GridBagLayout());
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.weightx = 0.0;
+ gbc.weighty = 0.0;
+ gbc.anchor = GridBagConstraints.BASELINE_LEADING;
+ gbc.fill = GridBagConstraints.NONE;
+ gbc.gridwidth = 1;
+ gbc.gridheight = 1;
+
+ // "Scheme: "
+ gbc.gridx = 0;
+ gbc.gridy = 0;
+
+ presetsComboLabel = new JLabel(title + ":");
+ presetsPanel.add(presetsComboLabel, gbc);
+
+ List<Object> entries = Arrays
+ .asList((Object[]) BackupFilesPresetEntry.backupfilesPresetEntries);
+ List<String> tooltips = Arrays.asList(
+ BackupFilesPresetEntry.backupfilesPresetEntryDescriptions);
+ backupfilesPresetsCombo = JvSwingUtils.buildComboWithTooltips(entries,
+ tooltips);
+ /*
+ for (int i = 0; i < BackupFilesPresetEntry.backupfilesPresetEntries.length; i++)
+ {
+ backupfilesPresetsCombo
+ .addItem(BackupFilesPresetEntry.backupfilesPresetEntries[i]);
+ }
+ */
+
+ backupfilesPresetsCombo.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ int key = getComboIntStringKey(backupfilesPresetsCombo);
+ if (!customiseCheckbox.isSelected())
+ {
+ backupfilesPresetsComboLastSelected = key;
+ }
+ if (key == BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM)
+ {
+ if (customiseCheckbox.isSelected())
+ {
+ // got here by clicking on customiseCheckbox so don't change the values
+ backupfilesCustomOptionsSetEnabled();
+ }
+ else
+ {
+ backupsTabUpdatePresets();
+ backupfilesCustomOptionsSetEnabled();
+ }
+ }
+ else
+ {
+ customiseCheckbox.setSelected(false);
+ backupsTabUpdatePresets();
+ backupfilesCustomOptionsSetEnabled();
+ }
+ }
+ });
+
+ // dropdown list of preset schemes
+ gbc.gridx = 1;
+ presetsPanel.add(backupfilesPresetsCombo, gbc);
+
+ revertButton.setText(MessageManager.getString("label.cancel_changes"));
+ revertButton.setToolTipText(
+ MessageManager.getString("label.cancel_changes_description"));
+ revertButton.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ backupsSetOptions(
+ BackupFilesPresetEntry.backupfilesPresetEntriesValues.get(
+ BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM));
+ backupfilesCustomOptionsSetEnabled();
+ }
+
+ });
+ revertButton.setFont(LABEL_FONT);
+
+ customiseCheckbox.setFont(LABEL_FONT);
+ customiseCheckbox.setText(MessageManager.getString("label.customise"));
+ customiseCheckbox.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ int currently = getComboIntStringKey(backupfilesPresetsCombo);
+ if (customiseCheckbox.isSelected())
+ {
+ backupfilesPresetsComboLastSelected = currently;
+ setComboIntStringKey(backupfilesPresetsCombo,
+ BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM);
+ }
+ else
+ {
+ setComboIntStringKey(backupfilesPresetsCombo,
+ backupfilesPresetsComboLastSelected);
+
+ }
+ backupfilesCustomOptionsSetEnabled();
+ }
+ });
+ customiseCheckbox.setToolTipText(
+ MessageManager.getString("label.customise_description"));
+
+ // customise checkbox
+ gbc.gridx = 0;
+ gbc.gridy++;
+ presetsPanel.add(customiseCheckbox, gbc);
+
+ // "Cancel changes" button (aligned with combo box above)
+ gbc.gridx = 1;
+ presetsPanel.add(revertButton, gbc);
+
+ return presetsPanel;
+ }
+
+ private JPanel initBackupsTabFilenameExamplesPanel()
+ {
+ String title = MessageManager
+ .getString("label.scheme_examples");
+ TitledBorder tb = new TitledBorder(title);
+ exampleFilesPanel.setBorder(tb);
+ exampleFilesPanel.setLayout(new GridBagLayout());
+
+
+ backupfilesExampleLabel.setEditable(false);
+ backupfilesExampleLabel
+ .setBackground(exampleFilesPanel.getBackground());
+
+ updateBackupFilesExampleLabel();
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.weightx = 1.0;
+ gbc.weighty = 1.0;
+ gbc.fill = GridBagConstraints.NONE;
+ gbc.anchor = GridBagConstraints.FIRST_LINE_START;