mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
run command with dstore
This commit is contained in:
parent
e9a6d29ba1
commit
dd4b9d449c
5 changed files with 79 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -85,6 +85,16 @@ Contributors:
|
|||
enablesFor="1"
|
||||
id="org.eclipse.rse.shells.ui.actions.LaunchShellActionDelegate">
|
||||
</action>
|
||||
<!--
|
||||
<action
|
||||
label="test command"
|
||||
icon="./icons/full/obj16/systemshell.gif"
|
||||
tooltip="%Launch_Shell_Tooltip"
|
||||
class="org.eclipse.rse.shells.ui.actions.LaunchCommandActionDelegate"
|
||||
enablesFor="1"
|
||||
id="org.eclipse.rse.shells.ui.actions.LaunchCommandActionDelegate">
|
||||
</action>
|
||||
-->
|
||||
</objectContribution>
|
||||
</extension>
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue