use of org.cytoscape.app.internal.ui.downloadsites.DownloadSite in project cytoscape-impl by cytoscape.
the class CheckForUpdatesPanel method checkUpdates.
private void checkUpdates() {
final Set<App> appsToCheckUpdates = appManager.getInstalledApps();
taskManager.execute(new TaskIterator(new Task() {
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
taskMonitor.setTitle("Checking for updates");
WebQuerier webQuerier = appManager.getWebQuerier();
String siteName, siteUrl;
double progress = 0.0;
// Obtain apps listing from each site if not done so
for (DownloadSite downloadSite : downloadSitesManager.getDownloadSites()) {
siteName = downloadSite.getSiteName();
siteUrl = downloadSite.getSiteUrl();
taskMonitor.setStatusMessage("Obtaining apps listing from " + siteName + "(" + siteUrl + ") ...");
taskMonitor.setProgress(progress);
progress += 1.0 / (downloadSitesManager.getDownloadSites().size() + 1);
webQuerier.setCurrentAppStoreUrl(siteUrl);
Set<WebApp> webApps = webQuerier.getAllApps();
}
taskMonitor.setStatusMessage("Reading listings for new versions");
// We're 98% done.
taskMonitor.setProgress(0.98);
updateManager.checkForUpdates(appsToCheckUpdates);
}
@Override
public void cancel() {
// TODO Auto-generated method stub
}
}));
}
use of org.cytoscape.app.internal.ui.downloadsites.DownloadSite in project cytoscape-impl by cytoscape.
the class UpdateManager method handleEvent.
@Override
public void handleEvent(AppsFinishedStartingEvent event) {
for (DownloadSite downloadSite : downloadSitesManager.getDownloadSites()) {
appManager.getWebQuerier().setCurrentAppStoreUrl(downloadSite.getSiteUrl());
appManager.getWebQuerier().getAllApps();
}
checkForUpdates(appManager.getInstalledApps());
for (Update update : updates) {
userLogger.info("Update for " + update + " available (latest version: " + update.getUpdateVersion() + ", " + update.getApp().getVersion() + " installed)");
}
if (updates.size() > 0)
userLogger.info(updates.size() + " " + (updates.size() == 1 ? "update" : "updates") + " available");
}
Aggregations