setPrimaryValid(lAvailableBackups);
setPrimaryValid(lBackupID);
final LinkedHashSet<Message> errors = new LinkedHashSet<Message>();
BackupDescriptor backup = getSelectedBackup();
if (isLocal())
{
boolean selected = backupList.isVisible() && (backup != null);
if (!selected)
{
if (backupList.getRowCount() == 0)
{
setPrimaryInvalid(lPath);
errors.add(ERR_CTRL_PANEL_NO_PARENT_BACKUP_TO_VERIFY.get());
}
else
{
errors.add(ERR_CTRL_PANEL_REQUIRED_BACKUP_TO_VERIFY.get());
}
setPrimaryInvalid(lAvailableBackups);
}
}
else
{
String parentPath = parentDirectory.getText();
if ((parentPath == null) || (parentPath.trim().equals("")))
{
errors.add(ERR_CTRL_PANEL_NO_BACKUP_PATH_PROVIDED.get());
setPrimaryInvalid(lPath);
}
String id = backupID.getText();
if ((id == null) || (id.trim().equals("")))
{
errors.add(ERR_CTRL_PANEL_NO_BACKUP_ID_PROVIDED.get());
setPrimaryInvalid(lBackupID);
}
}
if (errors.isEmpty())
{
ProgressDialog progressDialog = new ProgressDialog(
Utilities.createFrame(), Utilities.getParentDialog(this), getTitle(),
getInfo());
RestoreTask newTask = new RestoreTask(getInfo(), progressDialog, false);
for (Task task : getInfo().getTasks())
{
task.canLaunch(newTask, errors);
}
// Ask for confirmation
boolean confirmed = true;
if (errors.isEmpty())
{
confirmed = displayConfirmationDialog(
INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(),
INFO_CTRL_PANEL_CONFIRM_RESTORE_DETAILS.get());
}
if ((errors.isEmpty()) && confirmed)
{
launchOperation(newTask,
INFO_CTRL_PANEL_RESTORING_SUMMARY.get(backup.getID()),
INFO_CTRL_PANEL_RESTORING_SUCCESSFUL_SUMMARY.get(),
INFO_CTRL_PANEL_RESTORING_SUCCESSFUL_DETAILS.get(),
ERR_CTRL_PANEL_RESTORING_ERROR_SUMMARY.get(),
null,
ERR_CTRL_PANEL_RESTORING_ERROR_DETAILS,