Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-08-02 11:07:09 -0400
committerUwe Stieber2012-08-02 11:07:35 -0400
commitb1015ee466ba25397d6e6e31119c0e97f0dc959c (patch)
tree3c8e1fad48c5f89493d3862ad982a41dff720454 /target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core
parent1d73cfd8931a20bb4f938bcbff90c6a29898955c (diff)
downloadorg.eclipse.tcf-b1015ee466ba25397d6e6e31119c0e97f0dc959c.tar.gz
org.eclipse.tcf-b1015ee466ba25397d6e6e31119c0e97f0dc959c.tar.xz
org.eclipse.tcf-b1015ee466ba25397d6e6e31119c0e97f0dc959c.zip
Target Explorer: Added advanced remote process launch tab section to specify the line ending used by the launched remote process
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/LaunchProcessStep.java43
1 files changed, 24 insertions, 19 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/LaunchProcessStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/LaunchProcessStep.java
index b4c6cffbd..63f75d25d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/LaunchProcessStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/LaunchProcessStep.java
@@ -109,33 +109,38 @@ public class LaunchProcessStep extends AbstractTcfLaunchStep {
launchAttributes.put(IProcessLauncher.PROP_PROCESS_ATTACH, Boolean.TRUE);
}
- // Launch the process
- IPropertiesContainer container = new PropertiesContainer();
- container.setProperties(launchAttributes);
-
+ // Determine the active peer
final IPeer peer = getActivePeerModel(fullQualifiedId, data).getPeer();
- // Determine if the launch is on local host. If yes, we can preset the
- // line ending character.
- final AtomicBoolean isLocalhost = new AtomicBoolean();
+ // Fill in the launch attributes
+ IPropertiesContainer container = new PropertiesContainer();
+ container.setProperties(launchAttributes);
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- if (ITransportTypes.TRANSPORT_TYPE_TCP.equals(peer.getTransportName())
- || ITransportTypes.TRANSPORT_TYPE_SSL.equals(peer.getTransportName())) {
- isLocalhost.set(IPAddressUtil.getInstance().isLocalHost(peer.getAttributes().get(IPeer.ATTR_IP_HOST)));
+ // If the line separator setting is not set explicitly, try to determine it automatically (local host only).
+ if (container.getProperty(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR) == null) {
+ // Determine if the launch is on local host. If yes, we can preset the
+ // line ending character.
+ final AtomicBoolean isLocalhost = new AtomicBoolean();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (ITransportTypes.TRANSPORT_TYPE_TCP.equals(peer.getTransportName())
+ || ITransportTypes.TRANSPORT_TYPE_SSL.equals(peer.getTransportName())) {
+ isLocalhost.set(IPAddressUtil.getInstance().isLocalHost(peer.getAttributes().get(IPeer.ATTR_IP_HOST)));
+ }
}
- }
- };
+ };
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
- if (isLocalhost.get()) {
- container.setProperty(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR, Host.isWindowsHost() ? ILineSeparatorConstants.LINE_SEPARATOR_CRLF : ILineSeparatorConstants.LINE_SEPARATOR_LF);
+ if (isLocalhost.get()) {
+ container.setProperty(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR, Host.isWindowsHost() ? ILineSeparatorConstants.LINE_SEPARATOR_CRLF : ILineSeparatorConstants.LINE_SEPARATOR_LF);
+ }
}
+ // Launch the process
launcher.launch(peer, container, new Callback(callback) {
@Override
protected void internalDone(Object caller, IStatus status) {

Back to the top