From 8392333302cb143aa38e0e789a4a2ae0f7888640 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Wed, 25 Jul 2007 20:35:23 +0000 Subject: [PATCH] [175277] Cannot disconnect multiple connections at once with multiselect --- .../SystemDisconnectAllSubSystemsAction.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemDisconnectAllSubSystemsAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemDisconnectAllSubSystemsAction.java index ccf83c4d348..d1414f86134 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemDisconnectAllSubSystemsAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemDisconnectAllSubSystemsAction.java @@ -12,10 +12,13 @@ * * Contributors: * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Kevin Doyle (IBM) - [175277] Cannot disconnect multiple connections at once with multiselect ********************************************************************************/ package org.eclipse.rse.internal.ui.actions; +import java.util.Iterator; + import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemRegistry; @@ -40,7 +43,7 @@ public class SystemDisconnectAllSubSystemsAction extends SystemBaseAction public SystemDisconnectAllSubSystemsAction(Shell shell) { super(SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_LABEL, SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_TOOLTIP, shell); - allowOnMultipleSelection(false); + allowOnMultipleSelection(true); setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION); sr = RSECorePlugin.getTheSystemRegistry(); // TODO help for connect all @@ -65,9 +68,14 @@ public class SystemDisconnectAllSubSystemsAction extends SystemBaseAction */ public void run() { - IHost conn = (IHost)getFirstSelection(); - try { - sr.disconnectAllSubSystems(conn); - } catch (Exception exc) {} // msg already shown + Iterator it = getSelection().iterator(); + while (it.hasNext()) { + Object item = it.next(); + if (item instanceof IHost) { + try { + sr.disconnectAllSubSystems((IHost) item); + } catch (Exception exc) {} // msg already shown + } + } } } \ No newline at end of file