summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCong Wang2013-04-29 12:23:25 (EDT)
committerChris Recoskie2013-04-29 12:23:25 (EDT)
commit0d192264a18aa7f4fdc267f1a8e88eeb4c6d708a (patch)
treede501fb5d48f0a7c794f722ae4c5c7c6667f3fac
parentc3d1a1c5bdd8b3640a8c7b0148044b1956b6812e (diff)
downloadorg.eclipse.ptp-0d192264a18aa7f4fdc267f1a8e88eeb4c6d708a.zip
org.eclipse.ptp-0d192264a18aa7f4fdc267f1a8e88eeb4c6d708a.tar.gz
org.eclipse.ptp-0d192264a18aa7f4fdc267f1a8e88eeb4c6d708a.tar.bz2
Bug 406717 - Browse button doesn't add "Home" directory to Remote Paths
and Symbols
-rw-r--r--rdt/org.eclipse.ptp.rdt.ui/src/org/eclipse/ptp/internal/rdt/ui/scannerinfo/RemoteIncludeDialog.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/rdt/org.eclipse.ptp.rdt.ui/src/org/eclipse/ptp/internal/rdt/ui/scannerinfo/RemoteIncludeDialog.java b/rdt/org.eclipse.ptp.rdt.ui/src/org/eclipse/ptp/internal/rdt/ui/scannerinfo/RemoteIncludeDialog.java
index 0e38387..0727280 100644
--- a/rdt/org.eclipse.ptp.rdt.ui/src/org/eclipse/ptp/internal/rdt/ui/scannerinfo/RemoteIncludeDialog.java
+++ b/rdt/org.eclipse.ptp.rdt.ui/src/org/eclipse/ptp/internal/rdt/ui/scannerinfo/RemoteIncludeDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2013 IBM Corporation and others.
* 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
@@ -16,6 +16,7 @@ import org.eclipse.ptp.remote.core.IRemoteConnection;
import org.eclipse.ptp.remote.ui.IRemoteUIConnectionManager;
import org.eclipse.ptp.remote.ui.IRemoteUIFileManager;
import org.eclipse.ptp.remote.ui.RemoteUIServices;
+import org.eclipse.rse.core.filters.SystemFilterReference;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.files.ui.dialogs.SystemRemoteFolderDialog;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
@@ -183,9 +184,17 @@ public class RemoteIncludeDialog extends Dialog {
folderDialog.setShowNewConnectionPrompt(false);
folderDialog.open();
Object remoteObject = folderDialog.getSelectedObject();
+
+ if (folderDialog.wasCancelled()) {
+ return;
+ }
if (remoteObject instanceof IRemoteFile) {
IRemoteFile folder = (IRemoteFile) remoteObject;
text.setText(folder.getCanonicalPath());
+ } else {
+ // the default directory is the home directory which is a type of SystemFilterReference.
+ String homeDir = ((SystemFilterReference) remoteObject).getSubSystem().getConnectorService().getHomeDirectory();
+ text.setText(homeDir);
}
} else {
IRemoteUIConnectionManager connMgr = getUIConnectionManager();