Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-09-25 03:35:40 -0400
committerTobias Schwarz2013-09-25 03:35:40 -0400
commit8d7ce65414a6a84bbd553ab4411e6970746bdd85 (patch)
tree0e2d7f8c1371c1482bc6026100137660838050b4 /target_explorer
parenta6ec528c9de091f555ed1a96ac3cfd10e0009a8a (diff)
downloadorg.eclipse.tcf-8d7ce65414a6a84bbd553ab4411e6970746bdd85.tar.gz
org.eclipse.tcf-8d7ce65414a6a84bbd553ab4411e6970746bdd85.tar.xz
org.eclipse.tcf-8d7ce65414a6a84bbd553ab4411e6970746bdd85.zip
Target Explorer: fix open dialog on not existing directory
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.java
index 040f92f5c..2727f5d14 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.java
@@ -135,6 +135,9 @@ public class FileSelectionControl extends BaseDialogSelectionControl {
IPath filePath = new Path(selectedFile);
// If the selected file points to an directory, use the directory as is
IPath filterPath = filePath.toFile().isDirectory() ? filePath : filePath.removeLastSegments(1);
+ while (filterPath != null && filterPath.segmentCount() > 1 && !filterPath.toFile().exists()) {
+ filterPath = filterPath.removeLastSegments(1);
+ }
String filterFileName = filePath.toFile().isDirectory() || !filePath.toFile().exists() ? null : filePath.lastSegment();
if (!filterPath.isEmpty()) fileDialog.setFilterPath(filterPath.toString());

Back to the top