Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-06-06 10:56:55 +0000
committerAndre Weinand2002-06-06 10:56:55 +0000
commit38651543da2cfa8b72a5312216d6af2c125b6a71 (patch)
tree2b97c31e35351e669e4e1f7f9953c9b9ca96ad11 /bundles
parentb3b23b3c5e2e1587fec182e610bf83560467f2a1 (diff)
downloadeclipse.platform.team-38651543da2cfa8b72a5312216d6af2c125b6a71.tar.gz
eclipse.platform.team-38651543da2cfa8b72a5312216d6af2c125b6a71.tar.xz
eclipse.platform.team-38651543da2cfa8b72a5312216d6af2c125b6a71.zip
four F3 fixes: #13949, #19013, #19216, #19371v20020606
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html33
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java28
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java35
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java61
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java16
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java21
-rw-r--r--bundles/org.eclipse.compare/plugin.properties2
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html33
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java6
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java28
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java35
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java10
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java61
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java4
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java16
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java21
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties2
20 files changed, 270 insertions, 162 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index ac4d2235c..5d09e301c 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -11,6 +11,37 @@
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
+Eclipse Build Input June 6th 2002
+
+<h2>
+What's new in this drop</h2>
+
+<h3>
+API changes</h3>
+
+<h3>
+API Additions</h3>
+New constant CompareUI.PLUGIN_ID
+
+<h3>
+Other highlights</h3>
+
+<h2>
+Known deficiencies</h2>
+
+<h2>
+Problem reports fixed</h2>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=13949">#13949</a>: DBCS: bogus at text compare<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19013">#19013</a>: backgronud color: is it honored?<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19216">#19216</a>: Accessibility in Workbench > Compare > Text Compare<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19371">#19371</a>: Java & Compare editor's Next/Previous toolbar buttons shouldn't be retargetable<br>
+
+
+<h2>
+Problem reports closed</h2>
+
+<h1>
+<hr WIDTH="100%"></h1>
Eclipse Build Input June 1st 2002
<h2>
@@ -43,8 +74,6 @@ Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=10790">#10790</a>: Patch does not apply if file not found locally<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=12643">#12643</a>: Expand all does not disable when there is no selection<br>
-
-
<h2>
Problem reports closed</h2>
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 5a39d9dc2..d439ee4a2 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
@@ -34,6 +34,12 @@ import org.eclipse.compare.structuremergeviewer.IStructureCreator;
*/
public final class CompareUI {
+ /**
+ * Compare Plug-in ID (value <code>"org.eclipse.compare"</code>).
+ * @since 2.0
+ */
+ public static final String PLUGIN_ID= "org.eclipse.compare"; //$NON-NLS-1$
+
/** Image descriptors for the 'Next' tool bar button. */
public static final ImageDescriptor DESC_DTOOL_NEXT= CompareUIPlugin.getImageDescriptor(CompareUIPlugin.DTOOL_NEXT);
public static final ImageDescriptor DESC_CTOOL_NEXT= CompareUIPlugin.getImageDescriptor(CompareUIPlugin.CTOOL_NEXT);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java
index e79b381ac..684c65f74 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java
@@ -11,17 +11,36 @@ import org.eclipse.compare.internal.CompareNavigator;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.Utilities;
-
+/**
+ * A <code>NavigationAction</code> is used to navigate through the individual
+ * differences of a <code>CompareEditorInput</code>.
+ * <p>
+ * Clients may instantiate this class; it is not intended to be subclassed.
+ * </p>
+ * @since 2.0
+ */
public class NavigationAction extends Action {
private boolean fNext;
private CompareEditorInput fCompareEditorInput;
+ /**
+ * Creates a <code>NavigationAction</code>.
+ *
+ * @param next if <code>true</code> action goes to the next difference; otherwise to the previous difference.
+ */
public NavigationAction(boolean next) {
this(CompareUIPlugin.getResourceBundle(), next);
}
+ /**
+ * Creates a <code>NavigationAction</code> that initializes its attributes
+ * from the given <code>ResourceBundle</code>.
+ *
+ * @param bundle is used to initialize the action
+ * @param next if <code>true</code> action goes to the next difference; otherwise to the previous difference.
+ */
public NavigationAction(ResourceBundle bundle, boolean next) {
Utilities.initAction(this, bundle, next ? "action.Next." : "action.Previous."); //$NON-NLS-2$ //$NON-NLS-1$
fNext= next;
@@ -35,7 +54,12 @@ public class NavigationAction extends Action {
}
}
+ /**
+ * Sets the <code>CompareEditorInput</code> on which this action operates.
+ *
+ * @param input the <code>CompareEditorInput</code> on which this action operates; if <code>null</code> action does nothing
+ */
public void setCompareEditorInput(CompareEditorInput input) {
fCompareEditorInput= input;
}
-} \ No newline at end of file
+}
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 017e2e3fd..56b46f456 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
@@ -13,8 +13,8 @@ import java.util.HashMap;
import java.util.ResourceBundle;
import java.io.InputStream;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import java.text.MessageFormat;
-import java.lang.InterruptedException;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.swt.SWT;
@@ -42,6 +42,7 @@ import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.CoreException;
@@ -174,7 +175,8 @@ public class TextMergeViewer extends ContentMergeViewer {
private RGB fBackground;
private RGB fForeground;
private boolean fPollSystemForeground= true;
-
+ private boolean fPollSystemBackground= true;
+
private RGB SELECTED_INCOMING;
private RGB INCOMING;
private RGB INCOMING_FILL;
@@ -614,9 +616,17 @@ public class TextMergeViewer extends ContentMergeViewer {
updateColors(display);
}
}
+ if (fPollSystemBackground) {
+ RGB bg= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB();
+ if (fBackground == null || !bg.equals(fBackground)) {
+ fBackground= bg;
+ updateColors(display);
+ }
+ }
}
public void setBackgroundColor(RGB background) {
+ fPollSystemBackground= (background == null);
fBackground= background;
updateColors(null);
}
@@ -675,6 +685,9 @@ public class TextMergeViewer extends ContentMergeViewer {
// invalidate color cache
fColors= null;
+ refreshBirdsEyeView();
+ invalidateLines();
+
updateAllDiffBackgrounds(display);
}
@@ -1566,8 +1579,16 @@ public class TextMergeViewer extends ContentMergeViewer {
IDocument d= v.getDocument();
if (d != null) {
String contents= d.get();
- if (contents != null)
- return contents.getBytes();
+ if (contents != null) {
+ byte[] bytes;
+ try {
+ bytes= contents.getBytes(ResourcesPlugin.getEncoding());
+ } catch(UnsupportedEncodingException ex) {
+ // use default encoding
+ bytes= contents.getBytes();
+ }
+ return bytes;
+ }
}
}
return null;
@@ -2622,20 +2643,20 @@ public class TextMergeViewer extends ContentMergeViewer {
if (isThreeWay()) {
if (Utilities.okToUse(fAncestorCanvas))
fAncestorCanvas.redraw();
- if (fAncestor.isControlOkToUse())
+ if (fAncestor != null && fAncestor.isControlOkToUse())
fAncestor.getTextWidget().redraw();
}
if (Utilities.okToUse(fLeftCanvas))
fLeftCanvas.redraw();
- if (fLeft.isControlOkToUse())
+ if (fLeft != null && fLeft.isControlOkToUse())
fLeft.getTextWidget().redraw();
if (Utilities.okToUse(getCenter()))
getCenter().redraw();
- if (fRight.isControlOkToUse())
+ if (fRight != null && fRight.isControlOkToUse())
fRight.getTextWidget().redraw();
if (Utilities.okToUse(fRightCanvas))
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 5ed4e2309..186006516 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
@@ -21,12 +21,18 @@ public class CompareEditorContributor extends EditorActionBarContributor {
private IgnoreWhiteSpaceAction fIgnoreWhitespace;
private NavigationAction fNext;
private NavigationAction fPrevious;
+
+ private NavigationAction fToolbarNext;
+ private NavigationAction fToolbarPrevious;
+
public CompareEditorContributor() {
ResourceBundle bundle= CompareUIPlugin.getResourceBundle();
fIgnoreWhitespace= new IgnoreWhiteSpaceAction(bundle, null);
fNext= new NavigationAction(bundle, true);
fPrevious= new NavigationAction(bundle, false);
+ fToolbarNext= new NavigationAction(bundle, true);
+ fToolbarPrevious= new NavigationAction(bundle, false);
}
/*
@@ -35,8 +41,8 @@ public class CompareEditorContributor extends EditorActionBarContributor {
public void contributeToToolBar(IToolBarManager tbm) {
tbm.add(new Separator());
tbm.add(fIgnoreWhitespace);
- tbm.add(fNext);
- tbm.add(fPrevious);
+ tbm.add(fToolbarNext);
+ tbm.add(fToolbarPrevious);
}
/*
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 e57afdf8f..e4dd22515 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
@@ -67,10 +67,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
private OverlayPreferenceStore fOverlayStore;
private Map fCheckBoxes= new HashMap();
private SelectionListener fCheckBoxListener;
- private Button fBackgroundDefaultRadioButton;
- private Button fBackgroundCustomRadioButton;
- private Button fBackgroundColorButton;
- private ColorEditor fBackgroundColorEditor;
public final OverlayPreferenceStore.OverlayKey[] fKeys= new OverlayPreferenceStore.OverlayKey[] {
@@ -150,8 +146,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
initializeFields();
super.performDefaults();
-
- //fPreviewViewer.invalidateTextPresentation();
}
/*
@@ -232,53 +226,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
GridLayout layout= new GridLayout();
layout.numColumns= 1;
composite.setLayout(layout);
-
- // background color
- Composite backgroundComposite= new Composite(composite, SWT.NULL);
- layout= new GridLayout();
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.numColumns= 2;
- backgroundComposite.setLayout(new RowLayout());
-
- Label label= new Label(backgroundComposite, SWT.NULL);
- label.setText(Utilities.getString("ComparePreferencePage.backgroundColor1.label")); //$NON-NLS-1$
-
- SelectionListener backgroundSelectionListener= new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- boolean custom= fBackgroundCustomRadioButton.getSelection();
- fBackgroundColorButton.setEnabled(custom);
- fOverlayStore.setValue(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, !custom);
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- };
-
- fBackgroundDefaultRadioButton= new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
- fBackgroundDefaultRadioButton.setText(Utilities.getString("ComparePreferencePage.backgroundColor2.label")); //$NON-NLS-1$
- fBackgroundDefaultRadioButton.addSelectionListener(backgroundSelectionListener);
-
- fBackgroundCustomRadioButton= new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
- fBackgroundCustomRadioButton.setText(Utilities.getString("ComparePreferencePage.backgroundColor3.label")); //$NON-NLS-1$
- fBackgroundCustomRadioButton.addSelectionListener(backgroundSelectionListener);
-
- fBackgroundColorEditor= new ColorEditor(backgroundComposite);
-
- fBackgroundColorButton= fBackgroundColorEditor.getButton();
- fBackgroundColorButton.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
- public void widgetSelected(SelectionEvent e) {
- PreferenceConverter.setValue(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, fBackgroundColorEditor.getColorValue());
- }
- }
- );
-
-
- // background color end
-
-
+
addCheckBox(composite, "ComparePreferencePage.synchronizeScrolling.label", SYNCHRONIZE_SCROLLING, 0); //$NON-NLS-1$
addCheckBox(composite, "ComparePreferencePage.initiallyShowAncestorPane.label", INITIALLY_SHOW_ANCESTOR_PANE, 0); //$NON-NLS-1$
@@ -334,13 +282,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
String key= (String) fCheckBoxes.get(b);
b.setSelection(fOverlayStore.getBoolean(key));
}
-
- RGB rgb= PreferenceConverter.getColor(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
- fBackgroundColorEditor.setColorValue(rgb);
- boolean default_= fOverlayStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT);
- fBackgroundDefaultRadioButton.setSelection(default_);
- fBackgroundCustomRadioButton.setSelection(!default_);
- fBackgroundColorButton.setEnabled(!default_);
}
// overlay stuff
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
index 696ec246a..951178767 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
@@ -10,6 +10,8 @@ import java.util.*;
import org.eclipse.swt.widgets.*;
+import org.eclipse.core.resources.ResourcesPlugin;
+
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.*;
@@ -165,7 +167,7 @@ public class Utilities {
StringBuffer buffer= new StringBuffer();
char[] part= new char[2048];
int read= 0;
- reader= new BufferedReader(new InputStreamReader(is));
+ reader= new BufferedReader(new InputStreamReader(is, ResourcesPlugin.getEncoding()));
while ((read= reader.read(part)) != -1)
buffer.append(part, 0, read);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java
index 5236f80e0..b4932a657 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java
@@ -8,6 +8,7 @@ import java.io.*;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.*;
import org.eclipse.compare.*;
@@ -38,10 +39,17 @@ import org.eclipse.compare.*;
is= new ByteArrayInputStream(new byte[0]);
}
if (is != null) {
- BufferedReader br= new BufferedReader(new InputStreamReader(is));
- String s= fPatcher.patch(fDiff,br, null);
- if (s != null)
- fContent= s.getBytes();
+
+ try {
+ String encoding= ResourcesPlugin.getEncoding();
+ BufferedReader br= new BufferedReader(new InputStreamReader(is, encoding));
+ String s= fPatcher.patch(fDiff,br, null);
+ if (s != null)
+ fContent= s.getBytes(encoding);
+ } catch (UnsupportedEncodingException e) {
+ throw new CoreException(new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, Platform.PLUGIN_ERROR, e.getMessage(), e));
+ }
+
try {
is.close();
} catch (IOException ex) {
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 23e26a51c..51e0b65cd 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
@@ -834,7 +834,16 @@ public class Patcher {
InputStream is= null;
try {
is= file.getContents();
- BufferedReader reader= new BufferedReader(new InputStreamReader(is));
+
+ Reader streamReader= null;
+ try {
+ streamReader= new InputStreamReader(is, ResourcesPlugin.getEncoding());
+ } catch (UnsupportedEncodingException x) {
+ // use default encoding
+ streamReader= new InputStreamReader(is);
+ }
+
+ BufferedReader reader= new BufferedReader(streamReader);
lines= new LineReader(reader).readLines();
} catch(CoreException ex) {
} finally {
@@ -863,7 +872,15 @@ public class Patcher {
*/
private void store(String contents, IFile file, IProgressMonitor pm) throws CoreException {
- InputStream is= new ByteArrayInputStream(contents.getBytes());
+ byte[] bytes;
+ try {
+ bytes= contents.getBytes(ResourcesPlugin.getEncoding());
+ } catch (UnsupportedEncodingException x) {
+ // uses default encoding
+ bytes= contents.getBytes();
+ }
+
+ InputStream is= new ByteArrayInputStream(bytes);
try {
if (file.exists()) {
file.setContents(is, false, true, pm);
diff --git a/bundles/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugin.properties
index 3a2d4eb00..18971a0d7 100644
--- a/bundles/org.eclipse.compare/plugin.properties
+++ b/bundles/org.eclipse.compare/plugin.properties
@@ -65,7 +65,7 @@ ComparePreferencePage.name= Compare
ComparePreferencePage.initiallyShowAncestorPane.label= Initially show a&ncestor pane
ComparePreferencePage.showPseudoConflicts.label= Show &pseudo conflicts
ComparePreferencePage.synchronizeScrolling.label= Synchronize &scrolling between panes in compare viewers
-ComparePreferencePage.textFont.label= Text Font
+ComparePreferencePage.textFont.label= Text &font
ComparePreferencePage.showMoreInfo.label= Show additional compare &information in the status line
ComparePreferencePage.preview.label= Preview:
ComparePreferencePage.ancestor.label= Common Ancestor
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 ac4d2235c..5d09e301c 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
@@ -11,6 +11,37 @@
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
+Eclipse Build Input June 6th 2002
+
+<h2>
+What's new in this drop</h2>
+
+<h3>
+API changes</h3>
+
+<h3>
+API Additions</h3>
+New constant CompareUI.PLUGIN_ID
+
+<h3>
+Other highlights</h3>
+
+<h2>
+Known deficiencies</h2>
+
+<h2>
+Problem reports fixed</h2>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=13949">#13949</a>: DBCS: bogus at text compare<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19013">#19013</a>: backgronud color: is it honored?<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19216">#19216</a>: Accessibility in Workbench > Compare > Text Compare<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19371">#19371</a>: Java & Compare editor's Next/Previous toolbar buttons shouldn't be retargetable<br>
+
+
+<h2>
+Problem reports closed</h2>
+
+<h1>
+<hr WIDTH="100%"></h1>
Eclipse Build Input June 1st 2002
<h2>
@@ -43,8 +74,6 @@ Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=10790">#10790</a>: Patch does not apply if file not found locally<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=12643">#12643</a>: Expand all does not disable when there is no selection<br>
-
-
<h2>
Problem reports closed</h2>
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 5a39d9dc2..d439ee4a2 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
@@ -34,6 +34,12 @@ import org.eclipse.compare.structuremergeviewer.IStructureCreator;
*/
public final class CompareUI {
+ /**
+ * Compare Plug-in ID (value <code>"org.eclipse.compare"</code>).
+ * @since 2.0
+ */
+ public static final String PLUGIN_ID= "org.eclipse.compare"; //$NON-NLS-1$
+
/** Image descriptors for the 'Next' tool bar button. */
public static final ImageDescriptor DESC_DTOOL_NEXT= CompareUIPlugin.getImageDescriptor(CompareUIPlugin.DTOOL_NEXT);
public static final ImageDescriptor DESC_CTOOL_NEXT= CompareUIPlugin.getImageDescriptor(CompareUIPlugin.CTOOL_NEXT);
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java
index e79b381ac..684c65f74 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java
@@ -11,17 +11,36 @@ import org.eclipse.compare.internal.CompareNavigator;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.Utilities;
-
+/**
+ * A <code>NavigationAction</code> is used to navigate through the individual
+ * differences of a <code>CompareEditorInput</code>.
+ * <p>
+ * Clients may instantiate this class; it is not intended to be subclassed.
+ * </p>
+ * @since 2.0
+ */
public class NavigationAction extends Action {
private boolean fNext;
private CompareEditorInput fCompareEditorInput;
+ /**
+ * Creates a <code>NavigationAction</code>.
+ *
+ * @param next if <code>true</code> action goes to the next difference; otherwise to the previous difference.
+ */
public NavigationAction(boolean next) {
this(CompareUIPlugin.getResourceBundle(), next);
}
+ /**
+ * Creates a <code>NavigationAction</code> that initializes its attributes
+ * from the given <code>ResourceBundle</code>.
+ *
+ * @param bundle is used to initialize the action
+ * @param next if <code>true</code> action goes to the next difference; otherwise to the previous difference.
+ */
public NavigationAction(ResourceBundle bundle, boolean next) {
Utilities.initAction(this, bundle, next ? "action.Next." : "action.Previous."); //$NON-NLS-2$ //$NON-NLS-1$
fNext= next;
@@ -35,7 +54,12 @@ public class NavigationAction extends Action {
}
}
+ /**
+ * Sets the <code>CompareEditorInput</code> on which this action operates.
+ *
+ * @param input the <code>CompareEditorInput</code> on which this action operates; if <code>null</code> action does nothing
+ */
public void setCompareEditorInput(CompareEditorInput input) {
fCompareEditorInput= input;
}
-} \ No newline at end of file
+}
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 017e2e3fd..56b46f456 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
@@ -13,8 +13,8 @@ import java.util.HashMap;
import java.util.ResourceBundle;
import java.io.InputStream;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import java.text.MessageFormat;
-import java.lang.InterruptedException;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.swt.SWT;
@@ -42,6 +42,7 @@ import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.CoreException;
@@ -174,7 +175,8 @@ public class TextMergeViewer extends ContentMergeViewer {
private RGB fBackground;
private RGB fForeground;
private boolean fPollSystemForeground= true;
-
+ private boolean fPollSystemBackground= true;
+
private RGB SELECTED_INCOMING;
private RGB INCOMING;
private RGB INCOMING_FILL;
@@ -614,9 +616,17 @@ public class TextMergeViewer extends ContentMergeViewer {
updateColors(display);
}
}
+ if (fPollSystemBackground) {
+ RGB bg= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB();
+ if (fBackground == null || !bg.equals(fBackground)) {
+ fBackground= bg;
+ updateColors(display);
+ }
+ }
}
public void setBackgroundColor(RGB background) {
+ fPollSystemBackground= (background == null);
fBackground= background;
updateColors(null);
}
@@ -675,6 +685,9 @@ public class TextMergeViewer extends ContentMergeViewer {
// invalidate color cache
fColors= null;
+ refreshBirdsEyeView();
+ invalidateLines();
+
updateAllDiffBackgrounds(display);
}
@@ -1566,8 +1579,16 @@ public class TextMergeViewer extends ContentMergeViewer {
IDocument d= v.getDocument();
if (d != null) {
String contents= d.get();
- if (contents != null)
- return contents.getBytes();
+ if (contents != null) {
+ byte[] bytes;
+ try {
+ bytes= contents.getBytes(ResourcesPlugin.getEncoding());
+ } catch(UnsupportedEncodingException ex) {
+ // use default encoding
+ bytes= contents.getBytes();
+ }
+ return bytes;
+ }
}
}
return null;
@@ -2622,20 +2643,20 @@ public class TextMergeViewer extends ContentMergeViewer {
if (isThreeWay()) {
if (Utilities.okToUse(fAncestorCanvas))
fAncestorCanvas.redraw();
- if (fAncestor.isControlOkToUse())
+ if (fAncestor != null && fAncestor.isControlOkToUse())
fAncestor.getTextWidget().redraw();
}
if (Utilities.okToUse(fLeftCanvas))
fLeftCanvas.redraw();
- if (fLeft.isControlOkToUse())
+ if (fLeft != null && fLeft.isControlOkToUse())
fLeft.getTextWidget().redraw();
if (Utilities.okToUse(getCenter()))
getCenter().redraw();
- if (fRight.isControlOkToUse())
+ if (fRight != null && fRight.isControlOkToUse())
fRight.getTextWidget().redraw();
if (Utilities.okToUse(fRightCanvas))
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 5ed4e2309..186006516 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
@@ -21,12 +21,18 @@ public class CompareEditorContributor extends EditorActionBarContributor {
private IgnoreWhiteSpaceAction fIgnoreWhitespace;
private NavigationAction fNext;
private NavigationAction fPrevious;
+
+ private NavigationAction fToolbarNext;
+ private NavigationAction fToolbarPrevious;
+
public CompareEditorContributor() {
ResourceBundle bundle= CompareUIPlugin.getResourceBundle();
fIgnoreWhitespace= new IgnoreWhiteSpaceAction(bundle, null);
fNext= new NavigationAction(bundle, true);
fPrevious= new NavigationAction(bundle, false);
+ fToolbarNext= new NavigationAction(bundle, true);
+ fToolbarPrevious= new NavigationAction(bundle, false);
}
/*
@@ -35,8 +41,8 @@ public class CompareEditorContributor extends EditorActionBarContributor {
public void contributeToToolBar(IToolBarManager tbm) {
tbm.add(new Separator());
tbm.add(fIgnoreWhitespace);
- tbm.add(fNext);
- tbm.add(fPrevious);
+ tbm.add(fToolbarNext);
+ tbm.add(fToolbarPrevious);
}
/*
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 e57afdf8f..e4dd22515 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
@@ -67,10 +67,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
private OverlayPreferenceStore fOverlayStore;
private Map fCheckBoxes= new HashMap();
private SelectionListener fCheckBoxListener;
- private Button fBackgroundDefaultRadioButton;
- private Button fBackgroundCustomRadioButton;
- private Button fBackgroundColorButton;
- private ColorEditor fBackgroundColorEditor;
public final OverlayPreferenceStore.OverlayKey[] fKeys= new OverlayPreferenceStore.OverlayKey[] {
@@ -150,8 +146,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
initializeFields();
super.performDefaults();
-
- //fPreviewViewer.invalidateTextPresentation();
}
/*
@@ -232,53 +226,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
GridLayout layout= new GridLayout();
layout.numColumns= 1;
composite.setLayout(layout);
-
- // background color
- Composite backgroundComposite= new Composite(composite, SWT.NULL);
- layout= new GridLayout();
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.numColumns= 2;
- backgroundComposite.setLayout(new RowLayout());
-
- Label label= new Label(backgroundComposite, SWT.NULL);
- label.setText(Utilities.getString("ComparePreferencePage.backgroundColor1.label")); //$NON-NLS-1$
-
- SelectionListener backgroundSelectionListener= new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- boolean custom= fBackgroundCustomRadioButton.getSelection();
- fBackgroundColorButton.setEnabled(custom);
- fOverlayStore.setValue(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, !custom);
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- };
-
- fBackgroundDefaultRadioButton= new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
- fBackgroundDefaultRadioButton.setText(Utilities.getString("ComparePreferencePage.backgroundColor2.label")); //$NON-NLS-1$
- fBackgroundDefaultRadioButton.addSelectionListener(backgroundSelectionListener);
-
- fBackgroundCustomRadioButton= new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
- fBackgroundCustomRadioButton.setText(Utilities.getString("ComparePreferencePage.backgroundColor3.label")); //$NON-NLS-1$
- fBackgroundCustomRadioButton.addSelectionListener(backgroundSelectionListener);
-
- fBackgroundColorEditor= new ColorEditor(backgroundComposite);
-
- fBackgroundColorButton= fBackgroundColorEditor.getButton();
- fBackgroundColorButton.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
- public void widgetSelected(SelectionEvent e) {
- PreferenceConverter.setValue(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, fBackgroundColorEditor.getColorValue());
- }
- }
- );
-
-
- // background color end
-
-
+
addCheckBox(composite, "ComparePreferencePage.synchronizeScrolling.label", SYNCHRONIZE_SCROLLING, 0); //$NON-NLS-1$
addCheckBox(composite, "ComparePreferencePage.initiallyShowAncestorPane.label", INITIALLY_SHOW_ANCESTOR_PANE, 0); //$NON-NLS-1$
@@ -334,13 +282,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
String key= (String) fCheckBoxes.get(b);
b.setSelection(fOverlayStore.getBoolean(key));
}
-
- RGB rgb= PreferenceConverter.getColor(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
- fBackgroundColorEditor.setColorValue(rgb);
- boolean default_= fOverlayStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT);
- fBackgroundDefaultRadioButton.setSelection(default_);
- fBackgroundCustomRadioButton.setSelection(!default_);
- fBackgroundColorButton.setEnabled(!default_);
}
// overlay stuff
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
index 696ec246a..951178767 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
@@ -10,6 +10,8 @@ import java.util.*;
import org.eclipse.swt.widgets.*;
+import org.eclipse.core.resources.ResourcesPlugin;
+
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.*;
@@ -165,7 +167,7 @@ public class Utilities {
StringBuffer buffer= new StringBuffer();
char[] part= new char[2048];
int read= 0;
- reader= new BufferedReader(new InputStreamReader(is));
+ reader= new BufferedReader(new InputStreamReader(is, ResourcesPlugin.getEncoding()));
while ((read= reader.read(part)) != -1)
buffer.append(part, 0, read);
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java
index 5236f80e0..b4932a657 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchedResource.java
@@ -8,6 +8,7 @@ import java.io.*;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.*;
import org.eclipse.compare.*;
@@ -38,10 +39,17 @@ import org.eclipse.compare.*;
is= new ByteArrayInputStream(new byte[0]);
}
if (is != null) {
- BufferedReader br= new BufferedReader(new InputStreamReader(is));
- String s= fPatcher.patch(fDiff,br, null);
- if (s != null)
- fContent= s.getBytes();
+
+ try {
+ String encoding= ResourcesPlugin.getEncoding();
+ BufferedReader br= new BufferedReader(new InputStreamReader(is, encoding));
+ String s= fPatcher.patch(fDiff,br, null);
+ if (s != null)
+ fContent= s.getBytes(encoding);
+ } catch (UnsupportedEncodingException e) {
+ throw new CoreException(new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, Platform.PLUGIN_ERROR, e.getMessage(), e));
+ }
+
try {
is.close();
} catch (IOException ex) {
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 23e26a51c..51e0b65cd 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
@@ -834,7 +834,16 @@ public class Patcher {
InputStream is= null;
try {
is= file.getContents();
- BufferedReader reader= new BufferedReader(new InputStreamReader(is));
+
+ Reader streamReader= null;
+ try {
+ streamReader= new InputStreamReader(is, ResourcesPlugin.getEncoding());
+ } catch (UnsupportedEncodingException x) {
+ // use default encoding
+ streamReader= new InputStreamReader(is);
+ }
+
+ BufferedReader reader= new BufferedReader(streamReader);
lines= new LineReader(reader).readLines();
} catch(CoreException ex) {
} finally {
@@ -863,7 +872,15 @@ public class Patcher {
*/
private void store(String contents, IFile file, IProgressMonitor pm) throws CoreException {
- InputStream is= new ByteArrayInputStream(contents.getBytes());
+ byte[] bytes;
+ try {
+ bytes= contents.getBytes(ResourcesPlugin.getEncoding());
+ } catch (UnsupportedEncodingException x) {
+ // uses default encoding
+ bytes= contents.getBytes();
+ }
+
+ InputStream is= new ByteArrayInputStream(bytes);
try {
if (file.exists()) {
file.setContents(is, false, true, pm);
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties
index 3a2d4eb00..18971a0d7 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties
@@ -65,7 +65,7 @@ ComparePreferencePage.name= Compare
ComparePreferencePage.initiallyShowAncestorPane.label= Initially show a&ncestor pane
ComparePreferencePage.showPseudoConflicts.label= Show &pseudo conflicts
ComparePreferencePage.synchronizeScrolling.label= Synchronize &scrolling between panes in compare viewers
-ComparePreferencePage.textFont.label= Text Font
+ComparePreferencePage.textFont.label= Text &font
ComparePreferencePage.showMoreInfo.label= Show additional compare &information in the status line
ComparePreferencePage.preview.label= Preview:
ComparePreferencePage.ancestor.label= Common Ancestor

Back to the top