diff options
author | Andre Weinand | 2004-04-23 14:19:24 +0000 |
---|---|---|
committer | Andre Weinand | 2004-04-23 14:19:24 +0000 |
commit | 1a1b1e0a7a9e0199e7c05a13dc41d70be7e44124 (patch) | |
tree | 06f96685d6deb1a262716a35b1f8e3d2cc3fd95c /bundles/org.eclipse.compare/compare | |
parent | 77bd2716f06fbd5e2eecb151a744596f46a44cc7 (diff) | |
download | eclipse.platform.team-1a1b1e0a7a9e0199e7c05a13dc41d70be7e44124.tar.gz eclipse.platform.team-1a1b1e0a7a9e0199e7c05a13dc41d70be7e44124.tar.xz eclipse.platform.team-1a1b1e0a7a9e0199e7c05a13dc41d70be7e44124.zip |
released Jared's patch for #50914
Diffstat (limited to 'bundles/org.eclipse.compare/compare')
-rw-r--r-- | bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java index 1aaaf2a75..db8000fed 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java @@ -44,6 +44,8 @@ import org.eclipse.core.runtime.*; private final static String STORE_PATCH_FILES_ID= PAGE_NAME + ".PATCH_FILES"; //$NON-NLS-1$ private final static String STORE_USE_CLIPBOARD_ID= PAGE_NAME + ".USE_CLIPBOARD"; //$NON-NLS-1$ + static final char SEPARATOR = System.getProperty ("file.separator").charAt (0); //$NON-NLS-1$ + private boolean fShowError= false; // SWT widgets @@ -346,12 +348,19 @@ import org.eclipse.core.runtime.*; protected void handlePatchFileBrowseButtonPressed() { FileDialog dialog= new FileDialog(getShell(), SWT.NONE); dialog.setText(PatchMessages.getString("InputPatchPage.SelectPatchFileDialog.title")); //$NON-NLS-1$ - dialog.setFilterPath(getPatchFilePath()); + String patchFilePath= getPatchFilePath(); + if (patchFilePath != null) { + int lastSegment= patchFilePath.lastIndexOf(SEPARATOR); + if (lastSegment > 0) { + patchFilePath= patchFilePath.substring(0, lastSegment); + } + } + dialog.setFilterPath(patchFilePath); String res= dialog.open(); if (res == null) return; - String patchFilePath= dialog.getFileName(); + patchFilePath= dialog.getFileName(); IPath filterPath= new Path(dialog.getFilterPath()); IPath path= filterPath.append(patchFilePath).makeAbsolute(); patchFilePath= path.toOSString(); |