Class MirrorManager
java.lang.Object
org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.MirrorManager
A manager class for handling the switching of the mirrored mode for each specialized
ContentMergeViewer
and TextMergeViewer
in EMF Compare,-
Constructor Summary
ConstructorDescriptionMirrorManager
(EMFCompareConfiguration configuration) Creates an instance for this confirmation. -
Method Summary
Modifier and TypeMethodDescriptionorg.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 Details
-
MirrorManager
Creates an instance for this confirmation.- Parameters:
configuration
- the EMF compare configuration.
-
-
Method Details
-
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.
-