Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2016-01-13 13:14:12 +0000
committerDani Megert2016-01-13 16:24:00 +0000
commitb39c96b5b9ef219a62925929107ad06c6b1e8c74 (patch)
tree056f3ad1c66c9aec4be68a565161bed318de314f /org.eclipse.ui.editors/src
parent48c24e2f1e475f55f3b737256122c0c0e32e36d6 (diff)
downloadeclipse.platform.text-b39c96b5b9ef219a62925929107ad06c6b1e8c74.tar.gz
eclipse.platform.text-b39c96b5b9ef219a62925929107ad06c6b1e8c74.tar.xz
eclipse.platform.text-b39c96b5b9ef219a62925929107ad06c6b1e8c74.zip
Bug 485746 - "Save As" for external files does not work as expected
Filter path for the FileDialog must be a directory, not the file path. Change-Id: Ia78fe8e561bdc672b7f3115b11a2130f98582625 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.ui.editors/src')
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
index d08346b7163..0545ac4de17 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -1502,9 +1502,9 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor {
if (input instanceof IURIEditorInput && !(input instanceof IFileEditorInput)) {
FileDialog dialog= new FileDialog(shell, SWT.SAVE);
IPath oldPath= URIUtil.toPath(((IURIEditorInput)input).getURI());
- if (oldPath != null) {
+ if (oldPath != null && !oldPath.isEmpty()) {
dialog.setFileName(oldPath.lastSegment());
- dialog.setFilterPath(oldPath.toOSString());
+ dialog.setFilterPath(oldPath.removeLastSegments(1).toOSString());
}
String path= dialog.open();

Back to the top