summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCong Wang2013-04-29 11:47:58 (EDT)
committer Chris Recoskie2013-04-29 11:47:58 (EDT)
commit6e5639c1e2e7bb25178c6d486cd1bfb906f3392a (patch)
treee99712a77976e4bb3a734c75a93d56abeb7107d5
parent2070f8ee988e7d06e14dcb1877b474819e79bee4 (diff)
downloadorg.eclipse.ptp-6e5639c1e2e7bb25178c6d486cd1bfb906f3392a.zip
org.eclipse.ptp-6e5639c1e2e7bb25178c6d486cd1bfb906f3392a.tar.gz
org.eclipse.ptp-6e5639c1e2e7bb25178c6d486cd1bfb906f3392a.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.java9
1 files changed, 9 insertions, 0 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 382b401..cd14216 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
@@ -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.PTPRemoteUIPlugin;
+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();