Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2004-04-23 10:19:24 -0400
committerAndre Weinand2004-04-23 10:19:24 -0400
commit1a1b1e0a7a9e0199e7c05a13dc41d70be7e44124 (patch)
tree06f96685d6deb1a262716a35b1f8e3d2cc3fd95c
parent77bd2716f06fbd5e2eecb151a744596f46a44cc7 (diff)
downloadeclipse.platform.team-1a1b1e0a7a9e0199e7c05a13dc41d70be7e44124.tar.gz
eclipse.platform.team-1a1b1e0a7a9e0199e7c05a13dc41d70be7e44124.tar.xz
eclipse.platform.team-1a1b1e0a7a9e0199e7c05a13dc41d70be7e44124.zip
released Jared's patch for #50914
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java13
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java13
2 files changed, 22 insertions, 4 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();
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
index 1aaaf2a75..db8000fed 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
+++ b/bundles/org.eclipse.compare/plugins/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();

Back to the top