bug 452356 - using o.e.remote: issues with remote browse dialog

This patch addresses an issue in the "Select Remote C/C++ Application
File" browse dialog: 
- The remote browse dialog's selected file or directory is still used 
in the launch configuration, even if the user cancels the browse dialog

Change-Id: Ib535254d681a349b2aadfe91adfc73d633a16e90
This commit is contained in:
Marc Dumais 2016-05-20 10:53:11 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent c3af58b543
commit 9dc70ec8a5

View file

@ -43,6 +43,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.window.Window;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteServicesManager;
import org.eclipse.remote.ui.dialogs.RemoteResourceBrowser;
@ -330,7 +331,13 @@ public class RemoteCDSFMainTab extends CMainTab {
SWT.NONE);
b.setConnection(currentConnectionSelected);
b.setTitle(Messages.RemoteCMainTab_Remote_Path_Browse_Button_Title);
b.open();
int returnCode = b.open();
// User cancelled the browse dialog?
if (returnCode == Window.CANCEL) {
return;
}
IFileStore selectedFile = b.getResource();
if (selectedFile != null) {
String absPath = selectedFile.toURI().getPath();