Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 112839 Details for
Bug 247282
[remotecdt] Make remotecdt work over any subsystem that has service which can be adapted to IShellService
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch that fixes the issue
remoteCDT-launchWithTerminals.diff (text/plain), 10.48 KB, created by
Anna Dushistova
on 2008-09-17 18:15:27 EDT
(
hide
)
Description:
patch that fixes the issue
Filename:
MIME Type:
Creator:
Anna Dushistova
Created:
2008-09-17 18:15:27 EDT
Size:
10.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.remotecdt >Index: src/org/eclipse/rse/internal/remotecdt/Activator.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/Activator.java,v >retrieving revision 1.1 >diff -u -r1.1 Activator.java >--- src/org/eclipse/rse/internal/remotecdt/Activator.java 29 Mar 2007 12:01:16 -0000 1.1 >+++ src/org/eclipse/rse/internal/remotecdt/Activator.java 17 Sep 2008 22:12:23 -0000 >@@ -1,17 +1,25 @@ > /******************************************************************************* >- * Copyright (c) 2006 PalmSource, Inc. >+ * Copyright (c) 2006, 2008 PalmSource, Inc. > * 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 > * > * Contributors: >- * Ewa Matejska (PalmSource) >+ * Ewa Matejska (PalmSource) - initial implementation >+ * Anna Dushistova (MontaVista) - [247282][remotecdt] Make remotecdt work over any subsystem that has service which can be adapted to IShellService > *******************************************************************************/ > > package org.eclipse.rse.internal.remotecdt; > >+import java.util.ArrayList; >+ > import org.eclipse.core.runtime.Plugin; >+import org.eclipse.rse.core.model.IHost; >+import org.eclipse.rse.core.model.SystemStartHere; >+import org.eclipse.rse.core.subsystems.ISubSystem; >+import org.eclipse.rse.services.IService; >+import org.eclipse.rse.services.shells.IShellService; > import org.osgi.framework.BundleContext; > > /** >@@ -54,5 +62,40 @@ > public static Activator getDefault() { > return plugin; > } >- >+ >+ public static IHost[] getSuitableHosts() >+ { >+ IHost[] connections = SystemStartHere.getConnections(); >+ ArrayList result=new ArrayList(); >+ for(int i=0; i<connections.length;i++) >+ { >+ if(getSuitableSubSystem(connections[i])!=null) >+ result.add(connections[i]); >+ } >+ return (IHost[]) result.toArray(new IHost[result.size()]); >+ } >+ >+ /** >+ * Find the first ISubSystem with service which adapts to IShellService >+ * associated with the host. >+ * >+ * @param host the connection >+ * @return ISubSystem with service which adapts to IShellService, or <code>null</code> if not found. >+ */ >+ public static ISubSystem getSuitableSubSystem(IHost host) { >+ if (host == null) >+ return null; >+ ISubSystem[] subSystems = host.getSubSystems(); >+ IShellService ssvc = null; >+ for (int i = 0; subSystems != null && i < subSystems.length; i++) { >+ IService svc = subSystems[i].getSubSystemConfiguration().getService(host); >+ if (svc!=null) { >+ ssvc = (IShellService)svc.getAdapter(IShellService.class); >+ if (ssvc != null) { >+ return subSystems[i]; >+ } >+ } >+ } >+ return null; >+ } > } >Index: src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java,v >retrieving revision 1.11 >diff -u -r1.11 RemoteCMainTab.java >--- src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java 26 May 2008 14:38:09 -0000 1.11 >+++ src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java 17 Sep 2008 22:12:23 -0000 >@@ -6,13 +6,14 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Ewa Matejska (PalmSource) - initial API and implementation >- * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry >- * Martin Oberhuber (Wind River) - [196934] hide disabled system types in remotecdt combo >- * Yu-Fen Kuo (MontaVista) - [190613] Fix NPE in Remotecdt when RSEUIPlugin has not been loaded >- * Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code >+ * Ewa Matejska (PalmSource) - initial API and implementation >+ * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry >+ * Martin Oberhuber (Wind River) - [196934] hide disabled system types in remotecdt combo >+ * Yu-Fen Kuo (MontaVista) - [190613] Fix NPE in Remotecdt when RSEUIPlugin has not been loaded >+ * Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code > * Johann Draschwandtner (Wind River) - [231827][remotecdt]Auto-compute default for Remote path > * Johann Draschwandtner (Wind River) - [233057][remotecdt]Fix button enablement >+ * Anna Dushistova (MontaVista) - [247282][remotecdt] Make remotecdt work over any subsystem that has service which can be adapted to IShellService > *******************************************************************************/ > > package org.eclipse.rse.internal.remotecdt; >@@ -475,7 +476,7 @@ > } else { > //already initialized > connectionCombo.removeAll(); >- IHost[] connections = RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationCategory("shells"); //$NON-NLS-1$ >+ IHost[] connections = Activator.getSuitableHosts(); > for(int i = 0; i < connections.length; i++) { > IRSESystemType sysType = connections[i].getSystemType(); > if (sysType!=null && sysType.isEnabled()) { >Index: src/org/eclipse/rse/internal/remotecdt/RemoteRunLaunchDelegate.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/RemoteRunLaunchDelegate.java,v >retrieving revision 1.7 >diff -u -r1.7 RemoteRunLaunchDelegate.java >--- src/org/eclipse/rse/internal/remotecdt/RemoteRunLaunchDelegate.java 28 Jul 2008 22:18:11 -0000 1.7 >+++ src/org/eclipse/rse/internal/remotecdt/RemoteRunLaunchDelegate.java 17 Sep 2008 22:12:23 -0000 >@@ -6,12 +6,13 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Ewa Matejska (PalmSource) - Adapted from LocalRunLaunchDelegate >+ * Ewa Matejska (PalmSource) - Adapted from LocalRunLaunchDelegate > * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API > * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry > * Martin Oberhuber (Wind River) - [226301][api] IShellService should throw SystemMessageException on error > * Anna Dushistova (MontaVista) - [234490][remotecdt] Launching with disconnected target fails > * Anna Dushistova (MontaVista) - [235298][remotecdt] Further improve progress reporting and cancellation of Remote CDT Launch >+ * Anna Dushistova (MontaVista) - [247282][remotecdt] Make remotecdt work over any subsystem that has service which can be adapted to IShellService > *******************************************************************************/ > > >@@ -262,7 +263,8 @@ > // Nothing to do. Download is skipped. > return null; > monitor.beginTask("Downloading remote file", 100); //$NON-NLS-1$ >- IFileService fileService = (IFileService) getConnectedRemoteService(config, FILE_SERVICE, new SubProgressMonitor(monitor, 10)); >+ IFileService fileService = getConnectedRemoteFileService(config, >+ new SubProgressMonitor(monitor, 10)); > File file = new File(localExePath); > Path remotePath = new Path(remoteExePath); > try { >@@ -282,7 +284,44 @@ > return null; > } > >- protected String getRemoteHostname(ILaunchConfiguration config) throws CoreException { >+ private IFileService getConnectedRemoteFileService( >+ ILaunchConfiguration config, SubProgressMonitor monitor) >+ throws CoreException { >+ >+ IHost currentConnection = getCurrentConnection(config); >+ >+ ISubSystem[] subSystems = currentConnection.getSubSystems(); >+ int i = 0; >+ for (i = 0; i < subSystems.length; i++) { >+ if (subSystems[i] instanceof IFileServiceSubSystem) >+ break; >+ } >+ >+ if (i >= subSystems.length) >+ abort(Messages.RemoteRunLaunchDelegate_4, null, >+ ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); >+ >+ final IFileServiceSubSystem subsystem = (IFileServiceSubSystem) subSystems[i]; >+ >+ try { >+ subsystem.connect(monitor, false); >+ } catch (CoreException e) { >+ throw e; >+ } catch (OperationCanceledException e) { >+ throw new CoreException(Status.CANCEL_STATUS); >+ } catch (Exception e) { >+ throw new CoreException(new Status(IStatus.ERROR, getPluginID(), >+ IStatus.OK, e.getLocalizedMessage(), e)); >+ } >+ >+ if (!subsystem.isConnected()) >+ abort(Messages.RemoteRunLaunchDelegate_5, null, >+ ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); >+ return subsystem.getFileService(); >+ } >+ >+ protected String getRemoteHostname(ILaunchConfiguration config) >+ throws CoreException { > IHost currentConnection = getCurrentConnection(config); > return currentConnection.getHostName(); > } >@@ -297,8 +336,8 @@ > spaceEscapify(remoteCommandPath) + " " + arguments; //$NON-NLS-1$ > String remote_command = real_remote_command + CMD_DELIMITER + EXIT_CMD; > >- >- IShellService shellService = (IShellService) getConnectedRemoteService(config, SHELL_SERVICE, new SubProgressMonitor(monitor,7)); >+ IShellService shellService = getConnectedRemoteShellService(config, >+ new SubProgressMonitor(monitor, 7)); > > // This is necessary because runCommand does not actually run the command right now. > String env[] = new String[0]; >@@ -318,6 +357,36 @@ > > } > >+ private IShellService getConnectedRemoteShellService( >+ ILaunchConfiguration config, SubProgressMonitor monitor) >+ throws CoreException { >+ >+ IHost currentConnection = getCurrentConnection(config); >+ >+ ISubSystem subsystem = Activator >+ .getSuitableSubSystem(currentConnection); >+ if (subsystem == null) >+ abort(Messages.RemoteRunLaunchDelegate_4, null, >+ ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); >+ try { >+ subsystem.connect(monitor, false); >+ } catch (CoreException e) { >+ throw e; >+ } catch (OperationCanceledException e) { >+ throw new CoreException(Status.CANCEL_STATUS); >+ } catch (Exception e) { >+ throw new CoreException(new Status(IStatus.ERROR, getPluginID(), >+ IStatus.OK, e.getLocalizedMessage(), e)); >+ } >+ >+ if (!subsystem.isConnected()) >+ abort(Messages.RemoteRunLaunchDelegate_5, null, >+ ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); >+ >+ return (IShellService) subsystem.getSubSystemConfiguration() >+ .getService(currentConnection).getAdapter(IShellService.class); >+ } >+ > protected String getPluginID() { > return "org.eclipse.rse.internal.remotecdt"; //$NON-NLS-1$ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mober.at+eclipse
:
review-
Actions:
View
|
Diff
Attachments on
bug 247282
: 112839