Lines 12-21
Link Here
|
12 |
* |
12 |
* |
13 |
* Contributors: |
13 |
* Contributors: |
14 |
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry |
14 |
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry |
|
|
15 |
* Kevin Doyle (IBM) - [175277] Cannot disconnect multiple connections at once with multiselect |
15 |
********************************************************************************/ |
16 |
********************************************************************************/ |
16 |
|
17 |
|
17 |
package org.eclipse.rse.internal.ui.actions; |
18 |
package org.eclipse.rse.internal.ui.actions; |
18 |
|
19 |
|
|
|
20 |
import java.util.Iterator; |
21 |
|
19 |
import org.eclipse.rse.core.RSECorePlugin; |
22 |
import org.eclipse.rse.core.RSECorePlugin; |
20 |
import org.eclipse.rse.core.model.IHost; |
23 |
import org.eclipse.rse.core.model.IHost; |
21 |
import org.eclipse.rse.core.model.ISystemRegistry; |
24 |
import org.eclipse.rse.core.model.ISystemRegistry; |
Lines 40-46
Link Here
|
40 |
public SystemDisconnectAllSubSystemsAction(Shell shell) |
43 |
public SystemDisconnectAllSubSystemsAction(Shell shell) |
41 |
{ |
44 |
{ |
42 |
super(SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_LABEL, SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_TOOLTIP, shell); |
45 |
super(SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_LABEL, SystemResources.ACTION_DISCONNECTALLSUBSYSTEMS_TOOLTIP, shell); |
43 |
allowOnMultipleSelection(false); |
46 |
allowOnMultipleSelection(true); |
44 |
setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION); |
47 |
setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION); |
45 |
sr = RSECorePlugin.getTheSystemRegistry(); |
48 |
sr = RSECorePlugin.getTheSystemRegistry(); |
46 |
// TODO help for connect all |
49 |
// TODO help for connect all |
Lines 65-73
Link Here
|
65 |
*/ |
68 |
*/ |
66 |
public void run() |
69 |
public void run() |
67 |
{ |
70 |
{ |
68 |
IHost conn = (IHost)getFirstSelection(); |
71 |
Iterator it = getSelection().iterator(); |
69 |
try { |
72 |
while (it.hasNext()) { |
70 |
sr.disconnectAllSubSystems(conn); |
73 |
Object item = it.next(); |
71 |
} catch (Exception exc) {} // msg already shown |
74 |
if (item instanceof IHost) { |
|
|
75 |
try { |
76 |
sr.disconnectAllSubSystems((IHost) item); |
77 |
} catch (Exception exc) {} // msg already shown |
78 |
} |
79 |
} |
72 |
} |
80 |
} |
73 |
} |
81 |
} |