{
Scheduler.get().scheduleDeferred(new ScheduledCommand()
{
public void execute()
{
final GlobalDisplay globalDisplay = RStudioGinjector.INSTANCE
.getGlobalDisplay();
buttonSpec.progressOperation.execute(new ProgressIndicator()
{
public void onProgress(String message)
{
if (dismissProgress_ != null)
dismissProgress_.execute();
dismissProgress_ = globalDisplay.showProgress(message);
}
public void clearProgress()
{
if (dismissProgress_ != null)
dismissProgress_.execute();
}
public void onCompleted()
{
if (dismissProgress_ != null)
dismissProgress_.execute();
}
public void onError(String message)
{
if (dismissProgress_ != null)
dismissProgress_.execute();
globalDisplay.showErrorMessage("Error", message);
}
});
}
});
}