Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2016-12-06 21:35:34 +0000
committerSergey Prigogin2016-12-06 21:35:34 +0000
commit97118c23b0193698f0b34f1468117c4070a797dc (patch)
treeb6c64ea94543153a999caf9bb30d98c2cf9b656b /bundles/org.eclipse.compare
parent3faf9a6c45cf2d8f3f7dfca712ef31c70a964826 (diff)
downloadeclipse.platform.team-97118c23b0193698f0b34f1468117c4070a797dc.tar.gz
eclipse.platform.team-97118c23b0193698f0b34f1468117c4070a797dc.tar.xz
eclipse.platform.team-97118c23b0193698f0b34f1468117c4070a797dc.zip
Revert "Bug 508257 - The "Swap sides" preference negatively affects Refactoring Preview dialog"Y20161208-1000S4_7_0_M4I20161208-0830I20161208-0730I20161207-2000I20161207-1340
Reverted due to reasons explained in https://bugs.eclipse.org/bugs/show_bug.cgi?id=508257#c10 This reverts commit 3faf9a6c45cf2d8f3f7dfca712ef31c70a964826. Change-Id: I745048552066b5605ed28279e2e3023781462139
Diffstat (limited to 'bundles/org.eclipse.compare')
-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.java30
2 files changed, 15 insertions, 57 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 6e18fbc9d..021451528 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareConfiguration.java
@@ -116,7 +116,6 @@ public class CompareConfiguration {
private IPreferenceStore fPreferenceStore;
private ListenerList<IPropertyChangeListener> fListeners= new ListenerList<>();
private HashMap<String, Object> fProperties= new HashMap<>();
- private boolean fMirroringEnabled = true;
private boolean fLeftEditable= true;
private boolean fRightEditable= true;
private String fAncestorLabel;
@@ -367,55 +366,16 @@ public class CompareConfiguration {
}
/**
- * Returns true if the compare viewer is mirrored, i.e. the left and the right panes are swapped.
- * Mirroring is enabled by default.
- * <p>
* <b>Only the views are mirrored. All model values for left and right are not changed!</b>
*
- * @return true if the compare viewer is mirrored. By default the Compare viewer is not mirrored.
+ * @return true if the left and right side of the viewer are mirrored. Default is false.
* @since 3.7
*/
public boolean isMirrored() {
- if (!fMirroringEnabled)
- return false;
Object property = getProperty(MIRRORED);
return property instanceof Boolean && (Boolean) property;
}
- /**
- * Returns true if mirroring of the compare viewer is enabled. Mirroring is enabled by default.
- *
- * @return true if mirroring is enabled
- * @see #isMirrored()
- * @see #setMirroringEnabled(boolean)
- * @since 3.7
- */
- public final boolean isMirroringEnabled() {
- return fMirroringEnabled;
- }
-
- /**
- * Enables or disables mirroring of the compare viewer, i.e. swapping of the left and the right panes.
- * The mirroring is enabled by default.
- * <p>
- * Code that always puts the after state on the right should disable mirroring. Code that may put the after state
- * on the left should not disable mirroring.
- * <p>
- * The "after" state is the state of the file after applying some particular change and is determined by user
- * actions rather than the file timestamps. For example, when previewing result of a revert operation, the "after"
- * state is the state of the file that existed at some point in the past.
- * <p>
- * When previewing a hypothetical change, the "after" state is the proposed future change and the "before" state
- * is the current state of the file. When comparing two existing file states, the "before" and "after" states
- * can be determined by chronology or by order in which the users selected the file states.
- *
- * @param value if true, the mirroring is enabled, otherwise disabled
- * @since 3.7
- */
- public final void setMirroringEnabled(boolean value) {
- fMirroringEnabled = value;
- }
-
private ImageDescriptor getImageDescriptor(int kind) {
return fgImages[(kind & 15) + (isMirrored() ? 16 : 0)];
}
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 b0f67a215..4f04b3f77 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
@@ -918,24 +918,22 @@ public abstract class ContentMergeViewer extends ContentViewer
tbm.appendToGroup("merge", copyRightToLeftItem); //$NON-NLS-1$
fHandlerService.registerAction(copyRightToLeftItem.getAction(), "org.eclipse.compare.copyAllRightToLeft"); //$NON-NLS-1$
- if (getCompareConfiguration().isMirroringEnabled()) {
- fSwitchLeftAndRight = new Action() {
- @Override
- public void run() {
- IPreferenceStore preferences = getCompareConfiguration().getPreferenceStore();
- preferences.setValue(ComparePreferencePage.SWAPPED, !getCompareConfiguration().isMirrored());
- if (preferences instanceof IPersistentPreferenceStore) {
- try {
- ((IPersistentPreferenceStore) preferences).save();
- } catch (IOException e) {
- CompareUIPlugin.log(e);
- }
+ fSwitchLeftAndRight = new Action() {
+ @Override
+ public void run() {
+ IPreferenceStore preferences = getCompareConfiguration().getPreferenceStore();
+ preferences.setValue(ComparePreferencePage.SWAPPED, !getCompareConfiguration().isMirrored());
+ if (preferences instanceof IPersistentPreferenceStore) {
+ try {
+ ((IPersistentPreferenceStore) preferences).save();
+ } catch (IOException e) {
+ CompareUIPlugin.log(e);
}
}
- };
- Utilities.initAction(fSwitchLeftAndRight, getResourceBundle(), "action.SwitchLeftAndRight."); //$NON-NLS-1$
- tbm.appendToGroup("modes", fSwitchLeftAndRight); //$NON-NLS-1$
- }
+ }
+ };
+ Utilities.initAction(fSwitchLeftAndRight, getResourceBundle(), "action.SwitchLeftAndRight."); //$NON-NLS-1$
+ tbm.appendToGroup("modes", fSwitchLeftAndRight); //$NON-NLS-1$
final ChangePropertyAction a= new ChangePropertyAction(fBundle, getCompareConfiguration(), "action.EnableAncestor.", ICompareUIConstants.PROP_ANCESTOR_VISIBLE); //$NON-NLS-1$
a.setChecked(fAncestorVisible);

Back to the top