configDialog.setVisible(true);
}
private void launch() {
try {
final Instance instance = launcher.getInstances().get(instancesTable.getSelectedRow());
boolean update = updateCheck.isSelected() && instance.isUpdatePending();
// Store last access date
Date now = new Date();
instance.setLastAccessed(now);
Persistence.commitAndForget(instance);
// Perform login
final Session session = LoginDialog.showLoginRequest(this, launcher);
if (session == null) {
return;
}
// If we have to update, we have to update
if (!instance.isInstalled()) {
update = true;
}
if (update) {
// Execute the updater
Updater updater = new Updater(launcher, instance);
updater.setOnline(session.isOnline());
ObservableFuture<Instance> future = new ObservableFuture<Instance>(
launcher.getExecutor().submit(updater), updater);
// Show progress
ProgressDialog.showProgress(
this, future, _("launcher.updatingTitle"), _("launcher.updatingStatus", instance.getTitle()));
SwingHelper.addErrorDialogCallback(this, future);
// Update the list of instances after updating
future.addListener(new Runnable() {
@Override