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 specializedContentMergeViewer
andTextMergeViewer
in EMF Compare,
-
-
Constructor Summary
Constructors Constructor Description MirrorManager(EMFCompareConfiguration configuration)
Creates an instance for this confirmation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jface.viewers.IContentProvider
getContentProvider(org.eclipse.jface.viewers.IContentProvider contentProvider)
Returns the appropriate content provider based on the current state ofForwardingCompareConfiguration.isMirrored()
.boolean
handlePropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent event)
Called from a derivedContentMergeViewer.handlePropertyChangeEvent(PropertyChangeEvent)
method to intercept the preference change for swapping, i.e., mirroring the sides.
-
-
-
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 ofForwardingCompareConfiguration.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 derivedContentMergeViewer.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 toContentMergeViewer.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.
-
-