Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2016-07-19 18:46:22 -0400
committerSergey Prigogin2016-07-19 19:04:01 -0400
commitd1a02b5588da41cf909755d308bae2f640998ce3 (patch)
tree7d918953121d67a3a7186a4fdce2974419904f5b
parent73fd0ef44b36fd04a8268b9600d4f21f91a43381 (diff)
downloadeclipse.platform.team-d1a02b5588da41cf909755d308bae2f640998ce3.tar.gz
eclipse.platform.team-d1a02b5588da41cf909755d308bae2f640998ce3.tar.xz
eclipse.platform.team-d1a02b5588da41cf909755d308bae2f640998ce3.zip
Revert "Bug 213780 - Compare With direction should be configurable"
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java42
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java37
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java79
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerResources.properties6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MirroredMergeViewerContentProvider.java97
-rw-r--r--bundles/org.eclipse.compare/icons/full/dlcl16/switch.pngbin401 -> 0 bytes
-rw-r--r--bundles/org.eclipse.compare/icons/full/elcl16/switch.pngbin558 -> 0 bytes
-rw-r--r--bundles/org.eclipse.compare/plugin.properties3
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java19
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java22
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java11
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CompareEditorTests.java26
14 files changed, 58 insertions, 292 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
index 2537a6577..aba9779de 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -8,7 +8,6 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Alex Blewitt <alex.blewitt@gmail.com> - replace new Boolean with Boolean.valueOf - https://bugs.eclipse.org/470344
- * Conrad Groth - Bug 213780 - Compare With direction should be configurable
*******************************************************************************/
package org.eclipse.compare;
@@ -72,21 +71,34 @@ public class CompareConfiguration {
* @since 3.0
*/
public static final String USE_OUTLINE_VIEW= "USE_OUTLINE_VIEW"; //$NON-NLS-1$
-
+
private static ImageDescriptor[] fgImages= new ImageDescriptor[16];
private static boolean fLeftIsLocal= true;
static {
- fgImages[Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/del_ov.gif"); //$NON-NLS-1$
- fgImages[Differencer.LEFT + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/r_inadd_ov.gif"); //$NON-NLS-1$
- fgImages[Differencer.RIGHT + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/r_outadd_ov.gif"); //$NON-NLS-1$
+ if (fLeftIsLocal) {
+ fgImages[Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/del_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.LEFT + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/r_inadd_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.RIGHT + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/r_outadd_ov.gif"); //$NON-NLS-1$
+
+ fgImages[Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/add_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.LEFT + Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/r_indel_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.RIGHT + Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/r_outdel_ov.gif"); //$NON-NLS-1$
- fgImages[Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/add_ov.gif"); //$NON-NLS-1$
- fgImages[Differencer.LEFT + Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/r_indel_ov.gif"); //$NON-NLS-1$
- fgImages[Differencer.RIGHT + Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/r_outdel_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.LEFT + Differencer.CHANGE]= CompareUIPlugin.getImageDescriptor("ovr16/r_inchg_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.RIGHT + Differencer.CHANGE]= CompareUIPlugin.getImageDescriptor("ovr16/r_outchg_ov.gif"); //$NON-NLS-1$
+ } else {
+ fgImages[Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/add_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.LEFT + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/inadd_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.RIGHT + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/outadd_ov.gif"); //$NON-NLS-1$
+
+ fgImages[Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/del_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.LEFT + Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/indel_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.RIGHT + Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/outdel_ov.gif"); //$NON-NLS-1$
- fgImages[Differencer.LEFT + Differencer.CHANGE]= CompareUIPlugin.getImageDescriptor("ovr16/r_inchg_ov.gif"); //$NON-NLS-1$
- fgImages[Differencer.RIGHT + Differencer.CHANGE]= CompareUIPlugin.getImageDescriptor("ovr16/r_outchg_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.LEFT + Differencer.CHANGE]= CompareUIPlugin.getImageDescriptor("ovr16/inchg_ov.gif"); //$NON-NLS-1$
+ fgImages[Differencer.RIGHT + Differencer.CHANGE]= CompareUIPlugin.getImageDescriptor("ovr16/outchg_ov.gif"); //$NON-NLS-1$
+ }
fgImages[Differencer.CONFLICTING + Differencer.ADDITION]= CompareUIPlugin.getImageDescriptor("ovr16/confadd_ov.gif"); //$NON-NLS-1$
fgImages[Differencer.CONFLICTING + Differencer.DELETION]= CompareUIPlugin.getImageDescriptor("ovr16/confdel_ov.gif"); //$NON-NLS-1$
@@ -252,14 +264,12 @@ public class CompareConfiguration {
if (fPreferenceStore != null) {
boolean b= fPreferenceStore.getBoolean(ComparePreferencePage.INITIALLY_SHOW_ANCESTOR_PANE);
setProperty(ICompareUIConstants.PROP_ANCESTOR_VISIBLE, Boolean.valueOf(b));
-
+
b= fPreferenceStore.getBoolean(ComparePreferencePage.IGNORE_WHITESPACE);
setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.valueOf(b));
-
- setProperty(ComparePreferencePage.LAYOUT, fPreferenceStore.getString(ComparePreferencePage.LAYOUT));
}
- }
-
+ }
+
/**
* Creates a new configuration with editable left and right sides,
* suitable default labels, and no images.
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
index 58ae50ac2..81cd5603b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -9,7 +9,6 @@
* IBM Corporation - initial API and implementation
* Alex Blewitt <alex.blewitt@gmail.com> - replace new Boolean with Boolean.valueOf - https://bugs.eclipse.org/470344
* Stefan Xenos <sxenos@gmail.com> (Google) - bug 448968 - Add diagnostic logging
- * Conrad Groth - Bug 213780 - Compare With direction should be configurable
*******************************************************************************/
package org.eclipse.compare.contentmergeviewer;
@@ -27,13 +26,11 @@ import org.eclipse.compare.internal.ChangePropertyAction;
import org.eclipse.compare.internal.CompareEditor;
import org.eclipse.compare.internal.CompareHandlerService;
import org.eclipse.compare.internal.CompareMessages;
-import org.eclipse.compare.internal.ComparePreferencePage;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.ICompareUIConstants;
import org.eclipse.compare.internal.IFlushable2;
import org.eclipse.compare.internal.ISavingSaveable;
import org.eclipse.compare.internal.MergeViewerContentProvider;
-import org.eclipse.compare.internal.MirroredMergeViewerContentProvider;
import org.eclipse.compare.internal.Policy;
import org.eclipse.compare.internal.Utilities;
import org.eclipse.compare.internal.ViewerSwitchingCancelled;
@@ -357,8 +354,6 @@ public abstract class ContentMergeViewer extends ContentViewer
}
}
};
- private final MergeViewerContentProvider defaultContentProvider;
- private boolean leftToRight;
//---- end
@@ -383,10 +378,7 @@ public abstract class ContentMergeViewer extends ContentViewer
fAncestorVisible= Utilities.getBoolean(cc, ICompareUIConstants.PROP_ANCESTOR_VISIBLE, fAncestorVisible);
fConfirmSave= Utilities.getBoolean(cc, CompareEditor.CONFIRM_SAVE_PROPERTY, fConfirmSave);
- defaultContentProvider = new MergeViewerContentProvider(cc);
- leftToRight = ICompareUIConstants.PREF_VALUE_LEFT_TO_RIGHT
- .equals(cc.getProperty(ComparePreferencePage.LAYOUT));
- updateContentProvider();
+ setContentProvider(new MergeViewerContentProvider(cc));
fCompareInputChangeListener= new ICompareInputChangeListener() {
public void compareInputChanged(ICompareInput input) {
@@ -543,12 +535,6 @@ public abstract class ContentMergeViewer extends ContentViewer
super.setContentProvider(contentProvider);
}
- private void updateContentProvider() {
- setContentProvider(leftToRight
- ? new MirroredMergeViewerContentProvider(defaultContentProvider)
- : defaultContentProvider);
- }
-
/* package */ IMergeViewerContentProvider getMergeContentProvider() {
return (IMergeViewerContentProvider) getContentProvider();
}
@@ -600,13 +586,6 @@ public abstract class ContentMergeViewer extends ContentViewer
setAncestorVisibility(false, !Utilities.getBoolean(getCompareConfiguration(), ICompareUIConstants.PROP_IGNORE_ANCESTOR, false));
return;
}
-
- if (key.equals(ComparePreferencePage.LAYOUT)) {
- leftToRight = ICompareUIConstants.PREF_VALUE_LEFT_TO_RIGHT
- .equals(event.getNewValue());
- updateContentProvider();
- return;
- }
}
void updateCursor(Control c, int dir) {
@@ -941,16 +920,6 @@ public abstract class ContentMergeViewer extends ContentViewer
tbm.appendToGroup("merge", fCopyRightToLeftAction); //$NON-NLS-1$
fHandlerService.registerAction(fCopyRightToLeftAction, "org.eclipse.compare.copyAllRightToLeft"); //$NON-NLS-1$
}
-
- Action switchLeftAndRight = new Action() {
- @Override
- public void run() {
- leftToRight = !leftToRight;
- updateContentProvider();
- }
- };
- Utilities.initAction(switchLeftAndRight, getResourceBundle(), "action.SwitchLeftAndRight."); //$NON-NLS-1$
- tbm.appendToGroup("modes", switchLeftAndRight); //$NON-NLS-1$
final ChangePropertyAction a= new ChangePropertyAction(fBundle, getCompareConfiguration(), "action.EnableAncestor.", ICompareUIConstants.PROP_ANCESTOR_VISIBLE); //$NON-NLS-1$
a.setChecked(fAncestorVisible);
@@ -958,7 +927,7 @@ public abstract class ContentMergeViewer extends ContentViewer
fAncestorItem.setVisible(false);
tbm.appendToGroup("modes", fAncestorItem); //$NON-NLS-1$
tbm.getControl().addDisposeListener(a);
-
+
createToolItems(tbm);
updateToolItems();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties
index fa02b6778..a459d147f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewerResources.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2016 IBM Corporation and others.
+# Copyright (c) 2000, 2011 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
@@ -73,9 +73,6 @@ action.IgnoreAncestor.description.unchecked=Two-Way Compare (Ignore Ancestor)
action.IgnoreAncestor.description.checked=Three-Way Compare
action.IgnoreAncestor.image=twowaycompare_co.gif
-action.SwitchLeftAndRight.label=Switch Left and Right View
-action.SwitchLeftAndRight.tooltip=Switch Left and Right View
-action.SwitchLeftAndRight.image=switch.png
#####################################################
# Context menu actions
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 f536729e1..8fe2bee11 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -8,16 +8,13 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Alex Blewitt <alex.blewitt@gmail.com> - replace new Boolean with Boolean.valueOf - https://bugs.eclipse.org/470344
- * Conrad Groth - Bug 213780 - Compare With direction should be configurable
*******************************************************************************/
package org.eclipse.compare.internal;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import org.eclipse.compare.CompareConfiguration;
@@ -28,8 +25,6 @@ import org.eclipse.compare.internal.core.ComparePlugin;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.compare.structuremergeviewer.Differencer;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.ComboFieldEditor;
-import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
@@ -103,14 +98,13 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
public static final String PATH_FILTER= PREFIX + "PathFilter"; //$NON-NLS-1$
public static final String ADDED_LINES_REGEX= PREFIX + "AddedLinesRegex"; //$NON-NLS-1$
public static final String REMOVED_LINES_REGEX= PREFIX + "RemovedLinesRegex"; //$NON-NLS-1$
- public static final String LAYOUT = PREFIX + "Layout"; //$NON-NLS-1$
-
+
private TextMergeViewer fPreviewViewer;
private IPropertyChangeListener fPreferenceChangeListener;
private CompareConfiguration fCompareConfiguration;
private OverlayPreferenceStore fOverlayStore;
- private Map<Button, String> fCheckBoxes = new HashMap<>();
+ private Map fCheckBoxes= new HashMap();
private Text fFilters;
private Text addedLinesRegex;
private Text removedLinesRegex;
@@ -135,9 +129,8 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PATH_FILTER),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ICompareUIConstants.PREF_NAVIGATION_END_ACTION),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL),
- new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, LAYOUT),
};
- private List<FieldEditor> editors = new ArrayList<>();
+ private RadioGroupFieldEditor editor;
private TabItem fTextCompareTab;
private Button fDisableCappingCheckBox;
@@ -160,7 +153,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
store.setDefault(PATH_FILTER, ""); //$NON-NLS-1$
store.setDefault(ICompareUIConstants.PREF_NAVIGATION_END_ACTION, ICompareUIConstants.PREF_VALUE_PROMPT);
store.setDefault(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL, ICompareUIConstants.PREF_VALUE_LOOP);
- store.setDefault(LAYOUT, ICompareUIConstants.PREF_VALUE_LEFT_TO_RIGHT);
}
public ComparePreferencePage() {
@@ -198,7 +190,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
fOverlayStore.setValue(ADDED_LINES_REGEX, addedLinesRegex.getText());
fOverlayStore.setValue(REMOVED_LINES_REGEX, removedLinesRegex.getText());
- editors.forEach(editor -> editor.store());
+ editor.store();
fOverlayStore.propagate();
ComparePlugin.getDefault().setCappingDisabled(
@@ -214,12 +206,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
fOverlayStore.loadDefaults();
initializeFields();
-
- // Workaround for Bug 497619
- if (fCompareConfiguration != null) {
- fCompareConfiguration.setProperty(LAYOUT, fOverlayStore.getString(LAYOUT));
- }
-
+
super.performDefaults();
}
@@ -369,13 +356,10 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
addCheckBox(composite, "ComparePreferencePage.highlightTokenChanges.label", HIGHLIGHT_TOKEN_CHANGES, 0); //$NON-NLS-1$
//addCheckBox(composite, "ComparePreferencePage.useResolveUI.label", USE_RESOLVE_UI, 0); //$NON-NLS-1$
fDisableCappingCheckBox = addCheckBox(composite, "ComparePreferencePage.disableCapping.label", CAPPING_DISABLED, 0); //$NON-NLS-1$
- addLayoutCombo(composite);
Composite radioGroup = new Composite(composite, SWT.NULL);
radioGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- RadioGroupFieldEditor editor = new RadioGroupFieldEditor(
- ICompareUIConstants.PREF_NAVIGATION_END_ACTION,
- CompareMessages.ComparePreferencePage_0, 1,
+ editor = new RadioGroupFieldEditor(ICompareUIConstants.PREF_NAVIGATION_END_ACTION, CompareMessages.ComparePreferencePage_0, 1,
new String[][] {
new String[] { CompareMessages.ComparePreferencePage_1, ICompareUIConstants.PREF_VALUE_PROMPT },
new String[] { CompareMessages.ComparePreferencePage_2, ICompareUIConstants.PREF_VALUE_LOOP },
@@ -385,7 +369,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
radioGroup, true);
editor.setPreferenceStore(fOverlayStore);
editor.fillIntoGrid(radioGroup, 1);
- editors.add(editor);
// a spacer
Label separator= new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
@@ -444,10 +427,10 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
private void initializeFields() {
- Iterator<Button> e = fCheckBoxes.keySet().iterator();
+ Iterator e= fCheckBoxes.keySet().iterator();
while (e.hasNext()) {
- Button b = e.next();
- String key= fCheckBoxes.get(b);
+ Button b= (Button) e.next();
+ String key= (String) fCheckBoxes.get(b);
b.setSelection(fOverlayStore.getBoolean(key));
}
@@ -458,7 +441,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
if (removedLinesRegex != null)
removedLinesRegex.setText(fOverlayStore.getString(REMOVED_LINES_REGEX));
- editors.forEach(editor -> editor.load());
+ editor.load();
}
// overlay stuff
@@ -472,13 +455,14 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalIndent= indentation;
+ gd.horizontalSpan= 2;
checkBox.setLayoutData(gd);
if (fCheckBoxListener == null) {
fCheckBoxListener= new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Button button= (Button) e.widget;
- fOverlayStore.setValue(fCheckBoxes.get(button), button.getSelection());
+ fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
}
};
}
@@ -488,42 +472,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
return checkBox;
}
-
- private void addLayoutCombo(Composite parent) {
- Composite c2 = new Composite(parent, SWT.NONE);
- c2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- c2.setLayout(layout);
-
- ComboFieldEditor layoutEditor = new ComboFieldEditor(LAYOUT,
- Utilities.getString("ComparePreferencePage.layout.label"), //$NON-NLS-1$
- new String[][]{
- getLayoutEntry(
- ICompareUIConstants.PREF_VALUE_RIGHT_TO_LEFT),
- getLayoutEntry(
- ICompareUIConstants.PREF_VALUE_LEFT_TO_RIGHT)},
- c2);
-
- layoutEditor.fillIntoGrid(c2, 2);
- layoutEditor.setPreferenceStore(fOverlayStore);
- editors.add(layoutEditor);
-
- layoutEditor.setPropertyChangeListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (fCompareConfiguration != null) {
- fCompareConfiguration.setProperty(LAYOUT, event.getNewValue());
- }
- }
- });
- }
-
- private String[] getLayoutEntry(String value) {
- String labelKey = "ComparePreferencePage.layout." + value; //$NON-NLS-1$
- return new String[]{Utilities.getString(labelKey), value};
- }
-
+
private String loadPreviewContentFromFile(String key) {
String preview= Utilities.getString(key);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java
index 0cbf825e0..8c0641678 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java
@@ -50,7 +50,4 @@ public interface ICompareUIConstants {
public static final String PREF_VALUE_DO_NOTHING = "doNothing"; //$NON-NLS-1$
public static final String COMMAND_IGNORE_WHITESPACE = PREFIX + "ignoreWhiteSpace"; //$NON-NLS-1$
-
- public static final String PREF_VALUE_LEFT_TO_RIGHT = "leftToRight"; //$NON-NLS-1$
- public static final String PREF_VALUE_RIGHT_TO_LEFT = "rightToLeft"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerResources.properties b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerResources.properties
index 439603d3e..3e733b451 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerResources.properties
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerResources.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2016 IBM Corporation and others.
+# Copyright (c) 2000, 2011 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
@@ -30,7 +30,3 @@ action.CopyRightToLeft.image= elcl16/copy_l_co.gif
action.EnableAncestor.label= Enable Ancestor Pane
action.EnableAncestor.tooltip= Control Visibility of Ancestor Pane
action.EnableAncestor.image= elcl16/ancestorpane_co.gif
-
-action.SwitchLeftAndRight.label=Switch Left and Right View
-action.SwitchLeftAndRight.tooltip=Switch Left and Right View
-action.SwitchLeftAndRight.image=switch.png
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MirroredMergeViewerContentProvider.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MirroredMergeViewerContentProvider.java
deleted file mode 100644
index 864c1953d..000000000
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MirroredMergeViewerContentProvider.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2016 Conrad Groth 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Conrad Groth - Bug 213780 - Compare With direction should be configurable
- *******************************************************************************/
-package org.eclipse.compare.internal;
-
-import org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This class just swaps the left and right input for display.
- * The model values for left and right are not changed.
- */
-public class MirroredMergeViewerContentProvider implements IMergeViewerContentProvider {
-
- private IMergeViewerContentProvider delegate;
-
- public MirroredMergeViewerContentProvider(IMergeViewerContentProvider delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public String getLeftLabel(Object input) {
- return delegate.getRightLabel(input);
- }
-
- @Override
- public Image getLeftImage(Object input) {
- return delegate.getRightImage(input);
- }
-
- @Override
- public Object getLeftContent(Object input) {
- return delegate.getRightContent(input);
- }
-
- @Override
- public boolean isLeftEditable(Object input) {
- return delegate.isRightEditable(input);
- }
-
- @Override
- public void saveLeftContent(Object input, byte[] bytes) {
- delegate.saveRightContent(input, bytes);
- }
-
- @Override
- public String getRightLabel(Object input) {
- return delegate.getLeftLabel(input);
- }
-
- @Override
- public Image getRightImage(Object input) {
- return delegate.getLeftImage(input);
- }
-
- @Override
- public Object getRightContent(Object input) {
- return delegate.getLeftContent(input);
- }
-
- @Override
- public boolean isRightEditable(Object input) {
- return delegate.isLeftEditable(input);
- }
-
- @Override
- public void saveRightContent(Object input, byte[] bytes) {
- delegate.saveLeftContent(input, bytes);
- }
-
- @Override
- public String getAncestorLabel(Object input) {
- return delegate.getAncestorLabel(input);
- }
-
- @Override
- public Image getAncestorImage(Object input) {
- return delegate.getAncestorImage(input);
- }
-
- @Override
- public Object getAncestorContent(Object input) {
- return delegate.getAncestorContent(input);
- }
-
- @Override
- public boolean showAncestor(Object input) {
- return delegate.showAncestor(input);
- }
-}
diff --git a/bundles/org.eclipse.compare/icons/full/dlcl16/switch.png b/bundles/org.eclipse.compare/icons/full/dlcl16/switch.png
deleted file mode 100644
index f3132b9dc..000000000
--- a/bundles/org.eclipse.compare/icons/full/dlcl16/switch.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.compare/icons/full/elcl16/switch.png b/bundles/org.eclipse.compare/icons/full/elcl16/switch.png
deleted file mode 100644
index 96cef47ee..000000000
--- a/bundles/org.eclipse.compare/icons/full/elcl16/switch.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugin.properties
index 55e120c35..9335310b5 100644
--- a/bundles/org.eclipse.compare/plugin.properties
+++ b/bundles/org.eclipse.compare/plugin.properties
@@ -132,9 +132,6 @@ ComparePreferencePage.synchronizeScrolling.label= Synchronize &scrolling between
ComparePreferencePage.useSingleLine.label= Connect &ranges with single line
ComparePreferencePage.highlightTokenChanges.label=&Highlight individual changes
ComparePreferencePage.disableCapping.label=Disable &capping when comparing large documents
-ComparePreferencePage.layout.label=La&yout:
-ComparePreferencePage.layout.rightToLeft=Right to left
-ComparePreferencePage.layout.leftToRight=Left to right
ComparePreferencePage.preview.label= Previe&w:
ComparePreferencePage.ancestor.label= Common Ancestor
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java
index 99e90de7a..c5cf39567 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java
@@ -10,19 +10,15 @@
*******************************************************************************/
package org.eclipse.compare.tests;
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.contentmergeviewer.ContentMergeViewer;
-import org.eclipse.compare.internal.ComparePreferencePage;
-import org.eclipse.compare.internal.CompareUIPlugin;
-import org.eclipse.compare.internal.ICompareUIConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.widgets.Composite;
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
public class ContentMergeViewerTest extends TestCase {
private MyContentMergeViewer myContentMergeViewer;
@@ -91,9 +87,6 @@ public class ContentMergeViewerTest extends TestCase {
}
protected void setUp() throws Exception {
- super.setUp();
- IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
- store.setDefault(ComparePreferencePage.LAYOUT, ICompareUIConstants.PREF_VALUE_RIGHT_TO_LEFT);
result = new boolean[] { false, false };
myContentMergeViewer = new MyContentMergeViewer();
myContentMergeViewer.addPropertyChangeListener(new IPropertyChangeListener() {
@@ -104,12 +97,6 @@ public class ContentMergeViewerTest extends TestCase {
});
}
- protected void tearDown() throws Exception {
- IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
- store.setToDefault(ComparePreferencePage.LAYOUT);
- super.tearDown();
- }
-
// set left to true
public void testFFTX() {
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java
index 98b125d58..f7c068f3a 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java
@@ -16,6 +16,8 @@ import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
+import junit.framework.TestCase;
+
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.ICompareFilter;
import org.eclipse.compare.IEditableContent;
@@ -23,9 +25,6 @@ import org.eclipse.compare.IStreamContentAccessor;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
import org.eclipse.compare.internal.ChangeCompareFilterPropertyAction;
-import org.eclipse.compare.internal.ComparePreferencePage;
-import org.eclipse.compare.internal.CompareUIPlugin;
-import org.eclipse.compare.internal.ICompareUIConstants;
import org.eclipse.compare.internal.IMergeViewerTestAdapter;
import org.eclipse.compare.internal.MergeViewerContentProvider;
import org.eclipse.compare.internal.Utilities;
@@ -34,7 +33,6 @@ import org.eclipse.compare.structuremergeviewer.Differencer;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
@@ -48,8 +46,6 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
-import junit.framework.TestCase;
-
public class TextMergeViewerTest extends TestCase {
/**
@@ -254,19 +250,7 @@ public class TextMergeViewerTest extends TestCase {
}
return document;
}
-
- protected void setUp() throws Exception {
- super.setUp();
- IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
- store.setDefault(ComparePreferencePage.LAYOUT, ICompareUIConstants.PREF_VALUE_RIGHT_TO_LEFT);
- }
-
- protected void tearDown() throws Exception {
- IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
- store.setToDefault(ComparePreferencePage.LAYOUT);
- super.tearDown();
- }
-
+
public void testCopyRightToLeft() throws Exception {
DiffNode parentNode = new DiffNode(new ParentTestElement(), new ParentTestElement());
String copiedText = "hi there";
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java
index 3daa4c94b..7591d873a 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/SaveableCompareEditorInputTest.java
@@ -16,14 +16,14 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
+import junit.framework.Test;
+
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.CompareViewerSwitchingPane;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
import org.eclipse.compare.internal.CompareEditor;
-import org.eclipse.compare.internal.ComparePreferencePage;
import org.eclipse.compare.internal.CompareUIPlugin;
-import org.eclipse.compare.internal.ICompareUIConstants;
import org.eclipse.compare.internal.MergeSourceViewer;
import org.eclipse.compare.structuremergeviewer.Differencer;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
@@ -36,7 +36,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILogListener;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
@@ -49,8 +48,6 @@ import org.eclipse.team.tests.core.TeamTest;
import org.eclipse.team.ui.synchronize.SaveableCompareEditorInput;
import org.eclipse.ui.PlatformUI;
-import junit.framework.Test;
-
public class SaveableCompareEditorInputTest extends TeamTest {
public static Test suite() {
@@ -70,8 +67,6 @@ public class SaveableCompareEditorInputTest extends TeamTest {
protected void setUp() throws Exception {
super.setUp();
- IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
- store.setDefault(ComparePreferencePage.LAYOUT, ICompareUIConstants.PREF_VALUE_RIGHT_TO_LEFT);
project = createProject("Project_", new String[] {
"File1.txt", "File2.txt" });
@@ -89,8 +84,6 @@ public class SaveableCompareEditorInputTest extends TeamTest {
protected void tearDown() throws Exception {
// remove log listener
RuntimeLog.removeLogListener(logListener);
- IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
- store.setToDefault(ComparePreferencePage.LAYOUT);
super.tearDown();
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CompareEditorTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CompareEditorTests.java
index f8118bade..dd0c8b15e 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CompareEditorTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CompareEditorTests.java
@@ -12,25 +12,19 @@ package org.eclipse.team.tests.ccvs.core.subscriber;
import java.io.ByteArrayInputStream;
-import org.eclipse.compare.CompareEditorInput;
-import org.eclipse.compare.ISharedDocumentAdapter;
-import org.eclipse.compare.SharedDocumentAdapter;
-import org.eclipse.compare.internal.ComparePreferencePage;
-import org.eclipse.compare.internal.CompareUIPlugin;
-import org.eclipse.compare.internal.ICompareUIConstants;
+import junit.framework.Test;
+
+import org.eclipse.compare.*;
import org.eclipse.compare.internal.Utilities;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.history.FileRevisionTypedElement;
@@ -40,16 +34,10 @@ import org.eclipse.team.internal.ui.synchronize.EditableSharedDocumentAdapter;
import org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement;
import org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction;
import org.eclipse.team.tests.ccvs.ui.ModelParticipantSyncInfoSource;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.*;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;
-import junit.framework.Test;
-
/**
* Test the behavior of compare editors opened on diffs.
*/
@@ -153,8 +141,6 @@ public class CompareEditorTests extends CVSSyncSubscriberTest {
protected void setUp() throws Exception {
super.setUp();
- IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
- store.setDefault(ComparePreferencePage.LAYOUT, ICompareUIConstants.PREF_VALUE_RIGHT_TO_LEFT);
// Need to set both the Compare and Team test flags to true
Utilities.RUNNING_TESTS = true;
Utils.RUNNING_TESTS = true;
@@ -168,8 +154,6 @@ public class CompareEditorTests extends CVSSyncSubscriberTest {
protected void tearDown() throws Exception {
closeAllEditors();
- IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
- store.setToDefault(ComparePreferencePage.LAYOUT);
super.tearDown();
}

Back to the top