Search in sources :

Example 1 with AppUninstallException

use of org.cytoscape.app.internal.exception.AppUninstallException in project cytoscape-impl by cytoscape.

the class CurrentlyInstalledAppsPanel method uninstallSelectedButtonActionPerformed.

private void uninstallSelectedButtonActionPerformed(ActionEvent evt) {
    // Obtain App objects corresponding to currently selected table entries
    Set<App> selectedApps = getSelectedApps();
    Map<App, Collection<App>> otherAppsDependingOn = getOtherAppsDependingOn(selectedApps);
    if (otherAppsDependingOn != null && !continueWithConflicts(otherAppsDependingOn))
        return;
    for (App app : selectedApps) {
        // Only uninstall apps that are installed
        if (app.getStatus() == AppStatus.INSTALLED || app.getStatus() == AppStatus.DISABLED || app.getStatus() == AppStatus.FAILED_TO_LOAD || app.getStatus() == AppStatus.FAILED_TO_START) {
            try {
                appManager.uninstallApp(app);
            } catch (AppUninstallException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }
    uninstallSelectedButton.setEnabled(false);
    disableSelectedButton.setEnabled(true);
    enableSelectedButton.setEnabled(true);
    appsAvailableTable.clearSelection();
}
Also used : BundleApp(org.cytoscape.app.internal.manager.BundleApp) App(org.cytoscape.app.internal.manager.App) SimpleApp(org.cytoscape.app.internal.manager.SimpleApp) Collection(java.util.Collection) AppUninstallException(org.cytoscape.app.internal.exception.AppUninstallException)

Aggregations

Collection (java.util.Collection)1 AppUninstallException (org.cytoscape.app.internal.exception.AppUninstallException)1 App (org.cytoscape.app.internal.manager.App)1 BundleApp (org.cytoscape.app.internal.manager.BundleApp)1 SimpleApp (org.cytoscape.app.internal.manager.SimpleApp)1