Package org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl

# Class AbstractMergeViewer

java.lang.Object
org.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.AbstractMergeViewer

All Implemented Interfaces:
  `IMergeViewer`, `org.eclipse.jface.viewers.IInputProvider`, `org.eclipse.jface.viewers.IInputSelectionProvider`, `org.eclipse.jface.viewers.ISelectionProvider`

Direct Known Subclasses:
  `AbstractStructuredMergeViewer`

public abstract class AbstractMergeViewer extends org.eclipse.jface.viewers.ContentViewer implements IMergeViewer
An abstract implementation of `IMergeViewer`.

Since:
  4.0

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer

`IMergeViewer.MergeViewerSide`

## Field Summary

### Fields inherited from class org.eclipse.jface.viewers.Viewer

`WIDGET_DATA_KEY`

## Constructor Summary

Constructors
Constructor
Description
`AbstractMergeViewer(IMergeViewer.MergeViewerSide side, IEMFCompareConfiguration compareConfiguration)`
Default constructor.

## Method Summary

Modifier and Type
Method
Description
`protected IEMFCompareConfiguration`
`getCompareConfiguration()`
Returns the compare configuration object used by this viewer.
`protected final com.google.common.base.Predicate<? super EObject>`
`getDifferenceFilter()`
Returns an aggregated predicate corresponding to the selected predicates of selected filters and unselected predicates of unselected filters in the UI.
`IDifferenceGroupProvider`
`getDifferenceGroupProvider()`
Returns the difference group provider selected in the UI.
`protected IMergeViewer.MergeViewerSide`
`getEffectiveSide()`
Returns the effective side taking into account `CompareConfiguration#isMirrored()` to switch left and right.
`IMergeViewer.MergeViewerSide`
`getSide()`
`void`
`handleDifferenceFilterChange(IDifferenceFilterChange event)`
Handle the change of filters in the UI.
`void`
`handleDifferenceGroupProviderChange(IDifferenceGroupProviderChange event)`
Handle the change of difference group provider in the UI.
`protected void`
`handleDispose(org.eclipse.swt.events.DisposeEvent event)`

### Methods inherited from class org.eclipse.jface.viewers.ContentViewer

`getContentProvider, getInput, getLabelProvider, handleLabelProviderChanged, hookControl, labelProviderChanged, setContentProvider, setInput, setLabelProvider`

### Methods inherited from class org.eclipse.jface.viewers.Viewer

`addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getControl, getData, getSelection, handleHelpRequest, inputChanged, refresh, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection, setSelection`

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

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

### Methods inherited from interface org.eclipse.jface.viewers.IInputProvider

`getInput`

### Methods inherited from interface org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer

`getControl, refresh, setInput, setSelection`

### Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider

`addSelectionChangedListener, getSelection, removeSelectionChangedListener, setSelection`

## Constructor Details

### AbstractMergeViewer

public AbstractMergeViewer(IMergeViewer.MergeViewerSide side, IEMFCompareConfiguration compareConfiguration)
Default constructor.

Parameters:
  `side` - the side of the viewer.
  `compareConfiguration` - the compare configuration object used by this viewer.

## Method Details

### getSide

public IMergeViewer.MergeViewerSide getSide()

Specified by:
  `getSide` in interface `IMergeViewer`
See Also:
  - `IMergeViewer.getSide()`

### getEffectiveSide

protected IMergeViewer.MergeViewerSide getEffectiveSide()
Returns the effective side taking into account `CompareConfiguration#isMirrored()` to switch left and right.

Parameters:
  `side` -
Returns:
  the effective side with respect to mirroring.

### getCompareConfiguration

protected IEMFCompareConfiguration getCompareConfiguration()
Returns the compare configuration object used by this viewer.

Returns:
  the compare configuration object used by this viewer.

### handleDispose

protected void handleDispose(org.eclipse.swt.events.DisposeEvent event)

Overrides:
  `handleDispose` in class `org.eclipse.jface.viewers.ContentViewer`
See Also:
  - `ContentViewer.handleDispose(org.eclipse.swt.events.DisposeEvent)`

### handleDifferenceGroupProviderChange

public void handleDifferenceGroupProviderChange(IDifferenceGroupProviderChange event)
Handle the change of difference group provider in the UI.

Parameters:
  `event` - an IDifferenceGroupProviderChange that stores the new selected difference group provider.

### getDifferenceGroupProvider

public IDifferenceGroupProvider getDifferenceGroupProvider()
Returns the difference group provider selected in the UI.

Returns:
  the difference group provider selected in the UI.

### handleDifferenceFilterChange

public void handleDifferenceFilterChange(IDifferenceFilterChange event)
Handle the change of filters in the UI.

Parameters:
  `event` - an IDifferenceFilterChange that stores the new state of filters.

### getDifferenceFilter

protected final com.google.common.base.Predicate<? super EObject> getDifferenceFilter()
Returns an aggregated predicate corresponding to the selected predicates of selected filters and unselected predicates of unselected filters in the UI.

Returns:
  an aggregated predicate corresponding to the selected predicates of selected filters and unselected predicates of unselected filters in the UI.