dialog.run(true, true, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
chartModel.setSuspendUpdates(true);
stockDatabase.getParent().fillHistoricalData(stockDatabase, newStartDate, newEndDate, new TaskMonitorAdapter(monitor, "Retrieving historical data..."));
chartModel.setSuspendUpdates(false);
} catch (Exception e) {
MessageDialog.openError(getShell(), "Error", "Error while retrieving historical data: " + LangUtils.exceptionMessage(e));
}
}});