Package org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer

## Class MirrorManager

- java.lang.Object
- - org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.MirrorManager

    public class MirrorManager
    extends Object

A manager class for handling the switching of the mirrored mode for each specialized `ContentMergeViewer` and `TextMergeViewer` in EMF Compare,

### Constructor Summary

Constructors
`MirrorManager​(EMFCompareConfiguration configuration)` Creates an instance for this confirmation.

### Method Summary

All Methods Instance Methods Concrete Methods
`org.eclipse.jface.viewers.IContentProvider` `getContentProvider​(org.eclipse.jface.viewers.IContentProvider contentProvider)` Returns the appropriate content provider based on the current state of `ForwardingCompareConfiguration.isMirrored()`.
`boolean` `handlePropertyChangeEvent​(org.eclipse.jface.util.PropertyChangeEvent event)` Called from a derived `ContentMergeViewer.handlePropertyChangeEvent(PropertyChangeEvent)` method to intercept the preference change for swapping, i.e., mirroring the sides.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MirrorManager

    public MirrorManager​(EMFCompareConfiguration configuration)

Creates an instance for this confirmation.

Parameters:
  `configuration` - the EMF compare configuration.

### Method Detail

#### getContentProvider

    public org.eclipse.jface.viewers.IContentProvider getContentProvider​(org.eclipse.jface.viewers.IContentProvider contentProvider)

Returns the appropriate content provider based on the current state of `ForwardingCompareConfiguration.isMirrored()`.

This method should be used in overrides of `ContentMergeViewer.setContentProvider(IContentProvider)` to automatically set the correctly mirrored content provider.

Parameters:
  `contentProvider` - the current content provider.
Returns:
  the appropriate content provider based on the current mirroring state.

#### handlePropertyChangeEvent

    public boolean handlePropertyChangeEvent​(org.eclipse.jface.util.PropertyChangeEvent event)

Called from a derived `ContentMergeViewer.handlePropertyChangeEvent(PropertyChangeEvent)` method to intercept the preference change for swapping, i.e., mirroring the sides.

If this method returns true, the caller should not call `super.handlePropertyChangeEvent(event)` but rather should do the processing themselves to avoid calls to `ContentMergeViewer.updateContentProvider()` which will set the bogus default content provider. The method sets the MIRRORED property of the configuration as is normally done when calling super.

Parameters:
  `event` - the event to handle.
Returns:
  true, if the property change is the property for the preference switching of sides, false otherwise.