private void dataSourceChanged(Object newDataSource) {
if (manager != null) {
manager.removeListener(this);
}
DownloadImpl dataSourcePlugin = null;
if (newDataSource instanceof DownloadImpl) {
dataSourcePlugin = (DownloadImpl) newDataSource;
manager = dataSourcePlugin.getDownload();
} else if (newDataSource instanceof DownloadManager) {
manager = (DownloadManager) newDataSource;
try {
dataSourcePlugin = DownloadManagerImpl.getDownloadStatic(manager);
} catch (DownloadException e) { /* Ignore */ }