diff options
author | Uwe Stieber | 2014-10-28 15:20:40 +0000 |
---|---|---|
committer | Uwe Stieber | 2014-10-28 15:20:40 +0000 |
commit | 604ed31c06a03f620269f9b2704e54a9b39fca1f (patch) | |
tree | f2f66758ac540efd28cb66d6971d696d8c63c5e6 | |
parent | fc65bd3b4ba390730e52df432b3e7eabbefc5ccd (diff) | |
download | org.eclipse.tcf-604ed31c06a03f620269f9b2704e54a9b39fca1f.tar.gz org.eclipse.tcf-604ed31c06a03f620269f9b2704e54a9b39fca1f.tar.xz org.eclipse.tcf-604ed31c06a03f620269f9b2704e54a9b39fca1f.zip |
Target Explorer: Also map remote path to host path if host path is empty
for C/C++ Remote Application launch
2 files changed, 47 insertions, 5 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/services/PathMapResolverService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/services/PathMapResolverService.java index b0e534e12..8a89fc8d7 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/services/PathMapResolverService.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/services/PathMapResolverService.java @@ -97,6 +97,7 @@ public class PathMapResolverService extends AbstractService implements IPathMapR if (rules != null && rules.length > 0) { for (IPathMap.PathMapRule rule : rules) { if (IPathMapService.PATHMAP_PROTOCOL_HOST_TO_TARGET.equals(rule.getProtocol())) continue; + if (rule.getClass().getName().endsWith("TCFLaunchDelegate$PathMapRule")) continue; //$NON-NLS-1$ String query = rule.getContextQuery(); if (query != null && query.length() > 0 && !query.equals("*")) continue; //$NON-NLS-1$ String hostPath = map(rule, targetPath); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TECDSFMainTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TECDSFMainTab.java index 17f298ec4..5c2425411 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TECDSFMainTab.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TECDSFMainTab.java @@ -65,6 +65,9 @@ public class TECDSFMainTab extends CMainTab { protected Text remoteProgText; protected Button skipDownloadButton; + protected boolean progTextFireNotification; + protected boolean remoteProgTextFireNotification; + private Text preRunText; private Label preRunLabel; @@ -90,9 +93,12 @@ public class TECDSFMainTab extends CMainTab { @SuppressWarnings("synthetic-access") @Override public void modifyText(ModifyEvent evt) { - setLocalPathForRemotePath(); + if (progTextFireNotification) { + setRemotePathFromLocalPath(); + } } }); + progTextFireNotification = true; } /* @@ -161,9 +167,13 @@ public class TECDSFMainTab extends CMainTab { @SuppressWarnings("synthetic-access") @Override public void modifyText(ModifyEvent evt) { + if (remoteProgTextFireNotification) { + setLocalPathFromRemotePath(); + } updateLaunchConfigurationDialog(); } }); + remoteProgTextFireNotification = true; remoteBrowseButton = createPushButton(mainComp, Messages.RemoteCMainTab_Remote_Path_Browse_Button, null); remoteBrowseButton.addSelectionListener(new SelectionAdapter() { @@ -247,7 +257,11 @@ public class TECDSFMainTab extends CMainTab { catch (CoreException e) { // Ignore } + + boolean prevRemoteProgTextFireNotification = remoteProgTextFireNotification; + remoteProgTextFireNotification = false; remoteProgText.setText(targetPath); + remoteProgTextFireNotification = prevRemoteProgTextFireNotification; String prelaunchCmd = null; try { @@ -270,11 +284,11 @@ public class TECDSFMainTab extends CMainTab { skipDownloadButton.setSelection(downloadToTarget); } - /* - * setLocalPathForRemotePath This function sets the remote path text field with the value of the - * local executable path. + /** + * Sets the remote path from the local path. Apply path mappings before + * setting the remote path. */ - private void setLocalPathForRemotePath() { + private void setRemotePathFromLocalPath() { String programName = fProgText.getText().trim(); if (programName != null && !"".equals(programName)) { //$NON-NLS-1$ @@ -284,7 +298,34 @@ public class TECDSFMainTab extends CMainTab { if (svc != null) { String remoteName = svc.findTargetPath(connection, programName); if (remoteName != null) { + boolean prevRemoteProgTextFireNotification = remoteProgTextFireNotification; + remoteProgTextFireNotification = false; remoteProgText.setText(remoteName); + remoteProgTextFireNotification = prevRemoteProgTextFireNotification; + } + } + } + } + } + + /** + * Sets the local path from the remote path. Apply path mappings before + * setting the local path. + */ + private void setLocalPathFromRemotePath() { + String remoteName = remoteProgText.getText().trim(); + + if (remoteName != null && !"".equals(remoteName)) { //$NON-NLS-1$ + IPeerNode connection = peerSelector.getPeerNode(); + if (connection != null) { + IPathMapResolverService svc = ServiceManager.getInstance().getService(connection, IPathMapResolverService.class); + if (svc != null) { + String programName = svc.findHostPath(connection, remoteName); + if (programName != null) { + boolean prevProgTextFireNotification = progTextFireNotification; + progTextFireNotification = false; + fProgText.setText(programName); + progTextFireNotification = prevProgTextFireNotification; } } } |