Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2005-05-06 19:03:14 +0000
committerAndre Weinand2005-05-06 19:03:14 +0000
commitc20c45827166a55c463dee961343be1bb02ca181 (patch)
tree75d03cafca038e02a4b9a880a76e2f306ccbc3b5
parent9df1b4f1c396aadb30220f28d8efe62b9fd326a5 (diff)
downloadeclipse.platform.team-c20c45827166a55c463dee961343be1bb02ca181.tar.gz
eclipse.platform.team-c20c45827166a55c463dee961343be1bb02ca181.tar.xz
eclipse.platform.team-c20c45827166a55c463dee961343be1bb02ca181.zip
ZRH build input for 20050506v20050506
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java14
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java14
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java12
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java7
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html1
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java14
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java3
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java5
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java3
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java14
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java3
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java5
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java5
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java6
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java12
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java7
24 files changed, 78 insertions, 78 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index dfedde899..a356b758d 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -17,6 +17,7 @@ Eclipse Build Input May 10th 2005
<h2>Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=93561">93561</a>: ResouceMapping changed to Internal<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=91005">91005</a>: reusing compare editor does not update title if filename stays the same<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=93810">93810</a>: Method extractPair(String, char, int[]) in Patcher.java fails on single number in range<br>
<h1><hr WIDTH="100%"></h1>
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
index 25c1517d3..66ace74bf 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
@@ -331,8 +331,10 @@ public final class CompareUI {
}
/**
- * @param input
- * @return
+ * Retrieve a document for the given input or return <code>null</code> if
+ * no document has been registered for the input.
+ * @param input the object for which to retrieve a document
+ * @return a document or <code>null</code> if no document was registered for the input
* @since 3.1
*/
public static IDocument getDocument(Object input) {
@@ -340,8 +342,9 @@ public final class CompareUI {
}
/**
- * @param input
- * @param document
+ * Register a document for the given input.
+ * @param input the object for which to register a document
+ * @param document the document to register
* @since 3.1
*/
public static void registerDocument(Object input, IDocument document) {
@@ -349,7 +352,8 @@ public final class CompareUI {
}
/**
- * @param document
+ * Unregister the given document.
+ * @param document the document to unregister
* @since 3.1
*/
public static void unregisterDocument(IDocument document) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 84c121b95..d402c0029 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -53,7 +53,6 @@ import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.progress.IProgressService;
import org.eclipse.compare.*;
@@ -961,7 +960,7 @@ public class TextMergeViewer extends ContentMergeViewer {
*/
protected void createControls(Composite composite) {
- WorkbenchHelp.setHelp(composite, ICompareContextIds.TEXT_MERGE_VIEW);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.TEXT_MERGE_VIEW);
// 1st row
if (fMarginWidth > 0) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java
index ae5711b72..5fb2efdbd 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java
@@ -16,8 +16,7 @@ import java.text.MessageFormat;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.help.WorkbenchHelp;
-
+import org.eclipse.ui.PlatformUI;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.compare.*;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
@@ -39,7 +38,7 @@ public class BinaryCompareViewer extends AbstractViewer {
public BinaryCompareViewer(Composite parent, CompareConfiguration cc) {
- WorkbenchHelp.setHelp(parent, ICompareContextIds.BINARY_COMPARE_VIEW);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.BINARY_COMPARE_VIEW);
fBundle= ResourceBundle.getBundle(BUNDLE_NAME);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
index 84caafb06..42cf30a30 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
@@ -21,7 +21,6 @@ import org.eclipse.jface.util.*;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
@@ -162,7 +161,7 @@ public class CompareEditor extends EditorPart implements IReusableEditor {
IEditorInput input= getEditorInput();
if (input instanceof CompareEditorInput) {
fControl= ((CompareEditorInput) input).createContents(parent);
- WorkbenchHelp.setHelp(fControl, ICompareContextIds.COMPARE_EDITOR);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(fControl, ICompareContextIds.COMPARE_EDITOR);
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
index 191983458..8031768a8 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
@@ -16,7 +16,7 @@ import org.eclipse.jface.action.*;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.ui.part.EditorActionBarContributor;
import org.eclipse.compare.*;
@@ -37,20 +37,22 @@ public class CompareEditorContributor extends EditorActionBarContributor {
public CompareEditorContributor() {
ResourceBundle bundle= CompareUI.getResourceBundle();
+ IWorkbenchHelpSystem helpSystem= PlatformUI.getWorkbench().getHelpSystem();
+
fIgnoreWhitespace= new IgnoreWhiteSpaceAction(bundle, null);
- WorkbenchHelp.setHelp(fIgnoreWhitespace, ICompareContextIds.IGNORE_WHITESPACE_ACTION);
+ helpSystem.setHelp(fIgnoreWhitespace, ICompareContextIds.IGNORE_WHITESPACE_ACTION);
fNext= new NavigationAction(bundle, true);
- WorkbenchHelp.setHelp(fNext, ICompareContextIds.GLOBAL_NEXT_DIFF_ACTION);
+ helpSystem.setHelp(fNext, ICompareContextIds.GLOBAL_NEXT_DIFF_ACTION);
fPrevious= new NavigationAction(bundle, false);
- WorkbenchHelp.setHelp(fPrevious, ICompareContextIds.GLOBAL_PREVIOUS_DIFF_ACTION);
+ helpSystem.setHelp(fPrevious, ICompareContextIds.GLOBAL_PREVIOUS_DIFF_ACTION);
fToolbarNext= new NavigationAction(bundle, true);
- WorkbenchHelp.setHelp(fToolbarNext, ICompareContextIds.NEXT_DIFF_ACTION);
+ helpSystem.setHelp(fToolbarNext, ICompareContextIds.NEXT_DIFF_ACTION);
fToolbarPrevious= new NavigationAction(bundle, false);
- WorkbenchHelp.setHelp(fToolbarPrevious, ICompareContextIds.PREVIOUS_DIFF_ACTION);
+ helpSystem.setHelp(fToolbarPrevious, ICompareContextIds.PREVIOUS_DIFF_ACTION);
}
/*
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
index fa6099d60..0760adf71 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
@@ -14,7 +14,6 @@ import java.io.*;
import java.util.*;
import org.eclipse.ui.*;
-import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.swt.SWT;
@@ -195,7 +194,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
*/
protected Control createContents(Composite parent) {
- WorkbenchHelp.setHelp(parent, ICompareContextIds.COMPARE_PREFERENCE_PAGE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.COMPARE_PREFERENCE_PAGE);
fOverlayStore.load();
fOverlayStore.start();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
index 13f86fe3a..d39fbcc6b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
@@ -19,8 +19,7 @@ import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.help.WorkbenchHelp;
-
+import org.eclipse.ui.PlatformUI;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.compare.*;
@@ -43,7 +42,7 @@ public class ImageMergeViewer extends ContentMergeViewer {
public ImageMergeViewer(Composite parent, int styles, CompareConfiguration mp) {
super(styles, ResourceBundle.getBundle(BUNDLE_NAME), mp);
- WorkbenchHelp.setHelp(parent, ICompareContextIds.IMAGE_COMPARE_VIEW);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.IMAGE_COMPARE_VIEW);
buildControl(parent);
String title= Utilities.getString(getResourceBundle(), "title"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
index 3b4ab080d..964f9c953 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
@@ -16,8 +16,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
-
+import org.eclipse.ui.PlatformUI;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.DialogSettings;
@@ -60,7 +59,7 @@ public abstract class ResizableDialog extends Dialog {
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
if (fContextId != null)
- WorkbenchHelp.setHelp(newShell, fContextId);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, fContextId);
}
protected Point getInitialSize() {
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 9737291f8..24343029c 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
@@ -24,7 +24,7 @@ import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.*;
import org.eclipse.jface.wizard.*;
-import org.eclipse.ui.help.*;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.*;
import org.eclipse.compare.internal.ICompareContextIds;
@@ -59,7 +59,7 @@ import org.eclipse.core.runtime.*;
InputPatchPage(PatchWizard pw) {
- super("InputPatchPage", PatchMessages.InputPatchPage_title, null);
+ super("InputPatchPage", PatchMessages.InputPatchPage_title, null); //$NON-NLS-1$
fPatchWizard= pw;
setMessage(PatchMessages.InputPatchPage_message);
}
@@ -98,7 +98,7 @@ import org.eclipse.core.runtime.*;
updateWidgetEnablements();
Dialog.applyDialogFont(composite);
- WorkbenchHelp.setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE);
}
/* (non-JavaDoc)
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index b82803418..92ecdec1f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Martin Burger <m@rtin-burger.de> patch for #93810
*******************************************************************************/
package org.eclipse.compare.internal.patch;
@@ -563,8 +564,7 @@ public class Patcher {
* The parsing of the line starts at the position after
* the first occurrence of the given character start an ends
* at the first blank (or the end of the line).
- * If only a single number is found this is assumed to be the length of the range.
- * In this case the start of the range is set to 1.
+ * If only a single number is found this is assumed to be the start of a one line range.
* If an error occurs the range -1,-1 is returned.
*/
private void extractPair(String line, char start, int[] pair) {
@@ -585,9 +585,9 @@ public class Patcher {
if (comma >= 0) {
pair[0]= Integer.parseInt(line.substring(0, comma));
pair[1]= Integer.parseInt(line.substring(comma+1));
- } else {
- pair[0]= 1;
- pair[1]= Integer.parseInt(line.substring(comma+1));
+ } else { // abbreviated form for one line patch
+ pair[0]= Integer.parseInt(line);
+ pair[1]= 1;
}
}
@@ -729,7 +729,7 @@ public class Patcher {
lines.remove(pos);
} else if (controlChar == '+') {
// added lines
- lines.add(pos, line);
+ lines.add(pos, line);
pos++;
} else
Assert.isTrue(false, "doPatch: unknown control character: " + controlChar); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
index 222184700..b2599c436 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
@@ -23,8 +23,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.WorkbenchHelp;
-
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.jface.dialogs.Dialog;
@@ -165,7 +163,7 @@ import org.eclipse.compare.structuremergeviewer.*;
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
- WorkbenchHelp.setHelp(composite, ICompareContextIds.PATCH_PREVIEW_WIZARD_PAGE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_PREVIEW_WIZARD_PAGE);
setControl(composite);
@@ -593,7 +591,8 @@ import org.eclipse.compare.structuremergeviewer.*;
ArrayList failedHunks= new ArrayList();
Patcher patcher= fPatchWizard.getPatcher();
patcher.setFuzz(getFuzzFactor());
- patcher.apply(diff, file, create, failedHunks);
+ if (error == null)
+ patcher.apply(diff, file, create, failedHunks);
if (failedHunks.size() > 0)
diff.fRejected= fPatchWizard.getPatcher().getRejected(failedHunks);
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
index dfedde899..a356b758d 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
@@ -17,6 +17,7 @@ Eclipse Build Input May 10th 2005
<h2>Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=93561">93561</a>: ResouceMapping changed to Internal<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=91005">91005</a>: reusing compare editor does not update title if filename stays the same<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=93810">93810</a>: Method extractPair(String, char, int[]) in Patcher.java fails on single number in range<br>
<h1><hr WIDTH="100%"></h1>
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
index 25c1517d3..66ace74bf 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
@@ -331,8 +331,10 @@ public final class CompareUI {
}
/**
- * @param input
- * @return
+ * Retrieve a document for the given input or return <code>null</code> if
+ * no document has been registered for the input.
+ * @param input the object for which to retrieve a document
+ * @return a document or <code>null</code> if no document was registered for the input
* @since 3.1
*/
public static IDocument getDocument(Object input) {
@@ -340,8 +342,9 @@ public final class CompareUI {
}
/**
- * @param input
- * @param document
+ * Register a document for the given input.
+ * @param input the object for which to register a document
+ * @param document the document to register
* @since 3.1
*/
public static void registerDocument(Object input, IDocument document) {
@@ -349,7 +352,8 @@ public final class CompareUI {
}
/**
- * @param document
+ * Unregister the given document.
+ * @param document the document to unregister
* @since 3.1
*/
public static void unregisterDocument(IDocument document) {
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 84c121b95..d402c0029 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -53,7 +53,6 @@ import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.progress.IProgressService;
import org.eclipse.compare.*;
@@ -961,7 +960,7 @@ public class TextMergeViewer extends ContentMergeViewer {
*/
protected void createControls(Composite composite) {
- WorkbenchHelp.setHelp(composite, ICompareContextIds.TEXT_MERGE_VIEW);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.TEXT_MERGE_VIEW);
// 1st row
if (fMarginWidth > 0) {
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java
index ae5711b72..5fb2efdbd 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewer.java
@@ -16,8 +16,7 @@ import java.text.MessageFormat;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.help.WorkbenchHelp;
-
+import org.eclipse.ui.PlatformUI;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.compare.*;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
@@ -39,7 +38,7 @@ public class BinaryCompareViewer extends AbstractViewer {
public BinaryCompareViewer(Composite parent, CompareConfiguration cc) {
- WorkbenchHelp.setHelp(parent, ICompareContextIds.BINARY_COMPARE_VIEW);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.BINARY_COMPARE_VIEW);
fBundle= ResourceBundle.getBundle(BUNDLE_NAME);
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
index 84caafb06..42cf30a30 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
@@ -21,7 +21,6 @@ import org.eclipse.jface.util.*;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
@@ -162,7 +161,7 @@ public class CompareEditor extends EditorPart implements IReusableEditor {
IEditorInput input= getEditorInput();
if (input instanceof CompareEditorInput) {
fControl= ((CompareEditorInput) input).createContents(parent);
- WorkbenchHelp.setHelp(fControl, ICompareContextIds.COMPARE_EDITOR);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(fControl, ICompareContextIds.COMPARE_EDITOR);
}
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
index 191983458..8031768a8 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
@@ -16,7 +16,7 @@ import org.eclipse.jface.action.*;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.ui.part.EditorActionBarContributor;
import org.eclipse.compare.*;
@@ -37,20 +37,22 @@ public class CompareEditorContributor extends EditorActionBarContributor {
public CompareEditorContributor() {
ResourceBundle bundle= CompareUI.getResourceBundle();
+ IWorkbenchHelpSystem helpSystem= PlatformUI.getWorkbench().getHelpSystem();
+
fIgnoreWhitespace= new IgnoreWhiteSpaceAction(bundle, null);
- WorkbenchHelp.setHelp(fIgnoreWhitespace, ICompareContextIds.IGNORE_WHITESPACE_ACTION);
+ helpSystem.setHelp(fIgnoreWhitespace, ICompareContextIds.IGNORE_WHITESPACE_ACTION);
fNext= new NavigationAction(bundle, true);
- WorkbenchHelp.setHelp(fNext, ICompareContextIds.GLOBAL_NEXT_DIFF_ACTION);
+ helpSystem.setHelp(fNext, ICompareContextIds.GLOBAL_NEXT_DIFF_ACTION);
fPrevious= new NavigationAction(bundle, false);
- WorkbenchHelp.setHelp(fPrevious, ICompareContextIds.GLOBAL_PREVIOUS_DIFF_ACTION);
+ helpSystem.setHelp(fPrevious, ICompareContextIds.GLOBAL_PREVIOUS_DIFF_ACTION);
fToolbarNext= new NavigationAction(bundle, true);
- WorkbenchHelp.setHelp(fToolbarNext, ICompareContextIds.NEXT_DIFF_ACTION);
+ helpSystem.setHelp(fToolbarNext, ICompareContextIds.NEXT_DIFF_ACTION);
fToolbarPrevious= new NavigationAction(bundle, false);
- WorkbenchHelp.setHelp(fToolbarPrevious, ICompareContextIds.PREVIOUS_DIFF_ACTION);
+ helpSystem.setHelp(fToolbarPrevious, ICompareContextIds.PREVIOUS_DIFF_ACTION);
}
/*
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
index fa6099d60..0760adf71 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
@@ -14,7 +14,6 @@ import java.io.*;
import java.util.*;
import org.eclipse.ui.*;
-import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.swt.SWT;
@@ -195,7 +194,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
*/
protected Control createContents(Composite parent) {
- WorkbenchHelp.setHelp(parent, ICompareContextIds.COMPARE_PREFERENCE_PAGE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.COMPARE_PREFERENCE_PAGE);
fOverlayStore.load();
fOverlayStore.start();
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
index 13f86fe3a..d39fbcc6b 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
@@ -19,8 +19,7 @@ import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.help.WorkbenchHelp;
-
+import org.eclipse.ui.PlatformUI;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.compare.*;
@@ -43,7 +42,7 @@ public class ImageMergeViewer extends ContentMergeViewer {
public ImageMergeViewer(Composite parent, int styles, CompareConfiguration mp) {
super(styles, ResourceBundle.getBundle(BUNDLE_NAME), mp);
- WorkbenchHelp.setHelp(parent, ICompareContextIds.IMAGE_COMPARE_VIEW);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.IMAGE_COMPARE_VIEW);
buildControl(parent);
String title= Utilities.getString(getResourceBundle(), "title"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
index 3b4ab080d..964f9c953 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
@@ -16,8 +16,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
-
+import org.eclipse.ui.PlatformUI;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.DialogSettings;
@@ -60,7 +59,7 @@ public abstract class ResizableDialog extends Dialog {
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
if (fContextId != null)
- WorkbenchHelp.setHelp(newShell, fContextId);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, fContextId);
}
protected Point getInitialSize() {
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 9737291f8..24343029c 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
@@ -24,7 +24,7 @@ import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.*;
import org.eclipse.jface.wizard.*;
-import org.eclipse.ui.help.*;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.*;
import org.eclipse.compare.internal.ICompareContextIds;
@@ -59,7 +59,7 @@ import org.eclipse.core.runtime.*;
InputPatchPage(PatchWizard pw) {
- super("InputPatchPage", PatchMessages.InputPatchPage_title, null);
+ super("InputPatchPage", PatchMessages.InputPatchPage_title, null); //$NON-NLS-1$
fPatchWizard= pw;
setMessage(PatchMessages.InputPatchPage_message);
}
@@ -98,7 +98,7 @@ import org.eclipse.core.runtime.*;
updateWidgetEnablements();
Dialog.applyDialogFont(composite);
- WorkbenchHelp.setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE);
}
/* (non-JavaDoc)
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index b82803418..92ecdec1f 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Martin Burger <m@rtin-burger.de> patch for #93810
*******************************************************************************/
package org.eclipse.compare.internal.patch;
@@ -563,8 +564,7 @@ public class Patcher {
* The parsing of the line starts at the position after
* the first occurrence of the given character start an ends
* at the first blank (or the end of the line).
- * If only a single number is found this is assumed to be the length of the range.
- * In this case the start of the range is set to 1.
+ * If only a single number is found this is assumed to be the start of a one line range.
* If an error occurs the range -1,-1 is returned.
*/
private void extractPair(String line, char start, int[] pair) {
@@ -585,9 +585,9 @@ public class Patcher {
if (comma >= 0) {
pair[0]= Integer.parseInt(line.substring(0, comma));
pair[1]= Integer.parseInt(line.substring(comma+1));
- } else {
- pair[0]= 1;
- pair[1]= Integer.parseInt(line.substring(comma+1));
+ } else { // abbreviated form for one line patch
+ pair[0]= Integer.parseInt(line);
+ pair[1]= 1;
}
}
@@ -729,7 +729,7 @@ public class Patcher {
lines.remove(pos);
} else if (controlChar == '+') {
// added lines
- lines.add(pos, line);
+ lines.add(pos, line);
pos++;
} else
Assert.isTrue(false, "doPatch: unknown control character: " + controlChar); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
index 222184700..b2599c436 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
@@ -23,8 +23,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.WorkbenchHelp;
-
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.jface.dialogs.Dialog;
@@ -165,7 +163,7 @@ import org.eclipse.compare.structuremergeviewer.*;
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
- WorkbenchHelp.setHelp(composite, ICompareContextIds.PATCH_PREVIEW_WIZARD_PAGE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_PREVIEW_WIZARD_PAGE);
setControl(composite);
@@ -593,7 +591,8 @@ import org.eclipse.compare.structuremergeviewer.*;
ArrayList failedHunks= new ArrayList();
Patcher patcher= fPatchWizard.getPatcher();
patcher.setFuzz(getFuzzFactor());
- patcher.apply(diff, file, create, failedHunks);
+ if (error == null)
+ patcher.apply(diff, file, create, failedHunks);
if (failedHunks.size() > 0)
diff.fRejected= fPatchWizard.getPatcher().getRejected(failedHunks);

Back to the top