}
private void startAutoUpdate(final IStockDatabase stockDatabase) throws InvocationTargetException, InterruptedException {
ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
dialog.setCancelable(true);
final IRealTimeMarketDataManager realTimeMarketDataManager = (IRealTimeMarketDataManager) marketDataManager;
dialog.run(true, true, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
ITaskMonitor taskMonitor = new TaskMonitorAdapter(monitor, "Starting auto-update...");
realTimeMarketDataManager.startRealtimeUpdate(stockDatabase, true, taskMonitor);
} catch (Exception e) {
throw new InvocationTargetException(e);
}
}});
}