{
ArrayList<String> buttonLabels = new ArrayList<String>();
ArrayList<Operation> buttonOperations = new ArrayList<Operation>();
buttonLabels.add("Quit and Download...");
buttonOperations.add(new Operation() {
@Override
public void execute()
{
appQuit_.prepareForQuit("Update RStudio", new QuitContext()
{
@Override
public void onReadyToQuit(boolean saveChanges)
{
Desktop.getFrame().browseUrl(result.getUpdateUrl());
appQuit_.performQuit(saveChanges, null);
}
});
}
});
buttonLabels.add("Remind Later");
buttonOperations.add(new Operation() {
@Override
public void execute()
{
// Don't do anything here; the prompt will re-appear the next
// time we do an update check
}
});
// Only provide the option to ignore the update if it's not urgent.
if (result.getUpdateUrgency() == 0)
{
buttonLabels.add("Ignore Update");
buttonOperations.add(new Operation() {
@Override
public void execute()
{
ignoredUpdates_.addIgnoredUpdate(result.getUpdateVersion());
ignoredUpdatesDirty_ = true;