Search in sources :

Example 1 with Update

use of org.cytoscape.app.internal.net.Update in project cytoscape-impl by cytoscape.

the class CheckForUpdatesPanel method getSelectedUpdates.

/**
 * Obtain the set of {@link Update} objects corresponding to currently selected entries in the table of apps
 * @return A set of {@link Update} objects corresponding to selected apps in the table
 */
private Set<Update> getSelectedUpdates() {
    Set<Update> selectedUpdates = new HashSet<Update>();
    int[] selectedRows = updatesTable.getSelectedRows();
    for (int index = 0; index < selectedRows.length; index++) {
        Update update = (Update) updatesTable.getModel().getValueAt(updatesTable.convertRowIndexToModel(selectedRows[index]), 0);
        selectedUpdates.add(update);
    }
    return selectedUpdates;
}
Also used : Update(org.cytoscape.app.internal.net.Update) HashSet(java.util.HashSet)

Example 2 with Update

use of org.cytoscape.app.internal.net.Update 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));
}
Also used : App(org.cytoscape.app.internal.manager.App) WebApp(org.cytoscape.app.internal.net.WebApp) Update(org.cytoscape.app.internal.net.Update)

Example 3 with Update

use of org.cytoscape.app.internal.net.Update in project cytoscape-impl by cytoscape.

the class InstallUpdatesTask method run.

@Override
public void run(TaskMonitor taskMonitor) throws Exception {
    taskMonitor.setTitle("Install Updates");
    taskMonitor.setTitle("");
    List<WebApp> webApps = new ArrayList<WebApp>();
    for (Update update : updates) {
        webApps.add(update.getWebApp());
    }
    insertTasksAfterCurrentTask(new InstallAppsFromWebAppTask(webApps, appManager, false));
}
Also used : ArrayList(java.util.ArrayList) Update(org.cytoscape.app.internal.net.Update) WebApp(org.cytoscape.app.internal.net.WebApp)

Aggregations

Update (org.cytoscape.app.internal.net.Update)3 WebApp (org.cytoscape.app.internal.net.WebApp)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 App (org.cytoscape.app.internal.manager.App)1