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 Details

    • MirrorManager

      public MirrorManager(EMFCompareConfiguration configuration)
      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 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.