gbc.gridy++; // row 1
backupsTab.add(presetsPanel, gbc);
- // gbc.anchor = GridBagConstraints.NORTHWEST;
// now using whole row
gbc.gridwidth = 2;
gbc.gridheight = 1;
{
String title = MessageManager.getString("label.schemes");
- // TitledBorder tb = new TitledBorder(new EmptyBorder(0, 0, 0, 0), title);
- // TitledBorder tb = new TitledBorder(title);
- // tb.setTitleFont(LABEL_FONT);
- // presetsPanel.setBorder(tb);
presetsPanel.setLayout(new GridBagLayout());
kgbc.gridwidth = GridBagConstraints.REMAINDER;
kgbc.fill = GridBagConstraints.HORIZONTAL;
kgbc.weightx = 1.0;
- /*
- keepfilesPanel.add(backupfilesConfirmDelete.getTrueButton(), kgbc);
-
- // fourth row (indented)
- kgbc.gridy = 3;
- keepfilesPanel.add(backupfilesConfirmDelete.getFalseButton(), kgbc);
- */
JPanel jp = new JPanel();
jp.setLayout(new FlowLayout());
int uppersurround = 0;
StringBuilder exampleSB = new StringBuilder();
boolean firstLine = true;
+ int lineNumber = 0;
if (reverse)
{
if (index == min + lowersurround && index < max - uppersurround - 1)
{
exampleSB.append("\n...");
+ lineNumber++;
}
else if (index > min + lowersurround && index < max - uppersurround)
{
else
{
exampleSB.append("\n");
+ lineNumber++;
}
exampleSB.append(BackupFilenameParts.getBackupFilename(index,
base, suffix, digits));
if (index == min + lowersurround && index < max - uppersurround - 1)
{
exampleSB.append("\n...");
+ lineNumber++;
}
else if (index > min + lowersurround && index < max - uppersurround)
{
else
{
exampleSB.append("\n");
+ lineNumber++;
}
exampleSB.append(BackupFilenameParts.getBackupFilename(index,
base, suffix, digits));
}
+ // add some extra empty lines to pad out the example files box. ugh, please tell
+ // me how to do this better
+ int remainingLines = lowersurround + uppersurround + 1 - lineNumber;
+ if (remainingLines > 0)
+ {
+ for (int i = 0; i < remainingLines; i++)
+ {
+ exampleSB.append("\n ");
+ lineNumber++;
+ }
+ }
+
backupfilesExampleLabel.setText(exampleSB.toString());
}
protected void backupfilesCustomOptionsSetEnabled()
{
- // int scheme = getComboIntStringKey(backupfilesPresetsCombo);
- // boolean enabled = scheme == BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM &&
- // enableBackupFiles.isSelected();
boolean enabled = customiseCheckbox.isSelected();
- //boolean enabled = customiseCheckbox.isSelected() && enableBackupFiles.isSelected();
backupfilesRevertButtonSetEnabled(enabled);
backupfilesSuffixTemplateSetEnabled(enabled);