diff --git a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/client/ClientCommandHandler.java b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/client/ClientCommandHandler.java index 8cc4dabecc6..ae002f538cf 100644 --- a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/client/ClientCommandHandler.java +++ b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/client/ClientCommandHandler.java @@ -229,7 +229,7 @@ public class ClientCommandHandler extends CommandHandler commandRoot.addNestedData(command, false); } - + _sender.sendDocument(commandRoot, 3); if (_pendingKeepAliveConfirmation != null) @@ -254,7 +254,7 @@ public class ClientCommandHandler extends CommandHandler } _sender.sendClass(document); } - + } diff --git a/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml b/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml index 344ae41ecf9..667641ea8b6 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml +++ b/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml @@ -85,6 +85,16 @@ Contributors: enablesFor="1" id="org.eclipse.rse.shells.ui.actions.LaunchShellActionDelegate"> + diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/LaunchCommandActionDelegate.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/LaunchCommandActionDelegate.java new file mode 100644 index 00000000000..d381c34bcc3 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/LaunchCommandActionDelegate.java @@ -0,0 +1,53 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.shells.ui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.ui.IActionDelegate; +import org.eclipse.ui.actions.ActionDelegate; + +public class LaunchCommandActionDelegate extends ActionDelegate implements IActionDelegate +{ + private SystemCommandAction _launchAction; + private ISelection _selection; + public LaunchCommandActionDelegate() + { + super(); + } + + public void run(IAction action) + { + if (_launchAction == null) + { + _launchAction = new SystemCommandAction(SystemBasePlugin.getActiveWorkbenchShell(), false); + } + _launchAction.updateSelection((IStructuredSelection)_selection); + _launchAction.run(); + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) + */ + public void selectionChanged(IAction action, ISelection selection) + { + _selection = selection; + } +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java index 85dba627200..d7195155d8b 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java @@ -488,7 +488,15 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd */ public IRemoteCommandShell getDefaultShell(Shell shell) throws Exception { - return null; + IRemoteCommandShell[] shells = getShells(); + if (shells == null || shells.length == 0) + { + return runShell(shell, null); + } + else + { + return shells[0]; + } } /** diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java index e86dda78d58..39090d31574 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java @@ -33,6 +33,7 @@ import org.eclipse.rse.services.shells.IShellService; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell; +import org.eclipse.swt.widgets.Shell; @@ -40,6 +41,8 @@ public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements I { protected String _userHome = null; protected IShellService _hostService; + + public ShellServiceSubSystem(IHost host, IConnectorService connectorService, IShellService hostService) { super(host, connectorService); @@ -103,7 +106,7 @@ public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements I IShellService service = getShellService(); - IHostShell hostShell = service.launchShell(monitor, cwd, getUserAndHostEnvVarsAsStringArray()); + IHostShell hostShell = service.runCommand(monitor, cwd, cmd, getUserAndHostEnvVarsAsStringArray()); IServiceCommandShell cmdShell = createRemoteCommandShell(this, hostShell); hostShell.addOutputListener(cmdShell); @@ -176,7 +179,7 @@ public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements I IServiceCommandShell cmdWrapper = (IServiceCommandShell)command; cmdWrapper.writeToShell(cmd); cmdWrapper.updateHistory(cmd); - } + } } protected IServiceCommandShell createRemoteCommandShell(IRemoteCmdSubSystem cmdSS, IHostShell hostShell)