use of org.cytoscape.app.internal.manager.App in project cytoscape-impl by cytoscape.
the class UninstallTask method run.
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
if (app == null) {
taskMonitor.showMessage(TaskMonitor.Level.ERROR, "App name not provided");
return;
}
taskMonitor.setTitle("Uninstalling app " + app);
App appObject = getApp(app);
if (appObject == null) {
taskMonitor.showMessage(TaskMonitor.Level.ERROR, "Can't find app '" + app + "'");
return;
}
appManager.uninstallApp(appObject);
updateApps();
taskMonitor.showMessage(TaskMonitor.Level.INFO, "App '" + app + "' uninstalled");
}
use of org.cytoscape.app.internal.manager.App in project cytoscape-impl by cytoscape.
the class UpdateTask method run.
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
if (app == null) {
taskMonitor.showMessage(TaskMonitor.Level.ERROR, "App name not provided");
return;
}
if (app.equals("all")) {
}
updateList = new ArrayList<>();
Set<Update> updates = updateManager.getUpdates();
if (app.equals("all")) {
updateList.addAll(updates);
} else {
for (Update update : updates) {
App appObject = update.getApp();
if (appObject.getAppName().equalsIgnoreCase(app))
updateList.add(update);
}
}
taskMonitor.setTitle("Updating apps");
insertTasksAfterCurrentTask(new InstallUpdatesTask(updates, appManager));
}
use of org.cytoscape.app.internal.manager.App in project cytoscape-impl by cytoscape.
the class InstallAppsPanel method installFromFileButtonActionPerformed.
private void installFromFileButtonActionPerformed(ActionEvent evt) {
List<String> sha1Checksums = new ArrayList<String>();
for (App app : appManager.getApps()) {
sha1Checksums.add(app.getSha512Checksum());
}
// Setup a the file filter for the open file dialog
FileChooserFilter fileChooserFilter = new FileChooserFilter("Jar, Zip, and Karaf Kar Files (*.jar, *.zip, *.kar)", new String[] { "jar", "zip", "kar" });
Collection<FileChooserFilter> fileChooserFilters = new LinkedList<FileChooserFilter>();
fileChooserFilters.add(fileChooserFilter);
// Show the dialog
final File[] files = fileUtil.getFiles(parent, "Choose file(s)", FileUtil.LOAD, FileUtil.LAST_DIRECTORY, "Install", true, fileChooserFilters);
if (files != null) {
TaskIterator ti = new TaskIterator();
ti.append(new InstallAppsFromFileTask(Arrays.asList(files), appManager, true));
ti.append(new ShowInstalledAppsIfChangedTask(appManager, parent));
taskManager.setExecutionContext(parent);
taskManager.execute(ti);
}
}
use of org.cytoscape.app.internal.manager.App 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.manager.App in project cytoscape-impl by cytoscape.
the class CurrentlyInstalledAppsPanel method enableSelectedButtonActionPerformed.
private void enableSelectedButtonActionPerformed(ActionEvent evt) {
// Obtain App objects corresponding to currently selected table entries
Set<App> selectedApps = getSelectedApps();
for (App app : selectedApps) {
// Only install apps that are not already installed
if (app.getStatus() != AppStatus.INSTALLED) {
try {
appManager.installApp(app);
} catch (AppInstallException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
enableSelectedButton.setEnabled(false);
disableSelectedButton.setEnabled(true);
uninstallSelectedButton.setEnabled(true);
}
Aggregations