dialog.setCancelable(true);
dialog.run(true, true, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
ITaskMonitor taskMonitor = new TaskMonitorAdapter(monitor, "Retrieving historical data...");
marketDataManager.fillHistoricalData(stockDatabase, startDateTime, endDateTime, taskMonitor);
} catch (Exception e) {
throw new InvocationTargetException(e);
}
}});