org.eclipse.emf.compare.rcp.ui.internal.util

## Class MergeViewerUtil

- java.lang.Object
- - org.eclipse.emf.compare.rcp.ui.internal.util.MergeViewerUtil

    public final class MergeViewerUtil
    extends Object

### Method Summary

All Methods Static Methods Concrete Methods
`static EStructuralFeature` `getAffectedFeature(Diff diff)`
`static EObject` `getBestSideEObject(Match match, IMergeViewer.MergeViewerSide side)`
`static Object` `getDiffValue(Diff diff)` Returns either `ReferenceChange.getValue()`, `AttributeChange.getValue()` or a `FeatureMapChange.getValue()` depending on the runtime type of the give `diff` or null otherwise.
`static EObject` `getEObject(Match match, IMergeViewer.MergeViewerSide side)`
`static List<?>` `getFeatureValues(Match match, EStructuralFeature feature, IMergeViewer.MergeViewerSide side)`
`static Resource` `getResource(Comparison comparison, IMergeViewer.MergeViewerSide side, Diff diff)` Returns the current resource on the given side of the given comparison.
`static Object` `getResourceAttachmentChangeValue(ResourceAttachmentChange diff, IMergeViewer.MergeViewerSide side)`
`static List<EObject>` `getResourceContents(Comparison comparison, IMergeViewer.MergeViewerSide side, Diff diff)` Returns the contents of the current resource on the given side of the given comparison.
`static Object` `getValueFromDiff(Diff diff, IMergeViewer.MergeViewerSide side)`
`static Object` `getValueFromResourceAttachmentChange(ResourceAttachmentChange diff, Comparison comparison, IMergeViewer.MergeViewerSide side)`
`static List<?>` `getValues(Diff diff, IMergeViewer.MergeViewerSide side)`
`static boolean` `isMarkAsMerged(Diff diff, IMergeViewerItem item, IEMFCompareConfiguration compareConfiguration)` Checks if the given diff is considered as a mark as merged diff.
`static boolean` `isVisibleInMergeViewer(Diff diff, IDifferenceGroupProvider groupProvider, com.google.common.base.Predicate<? super EObject> predicate)` Returns true if the given diff is displayed in an group as provided by the `groupProvider` and not filtered by the given filter `predicate`.
`static Object` `matchingValue(Object object, Comparison comparison, IMergeViewer.MergeViewerSide side)`
`static Object` `matchingValue(Object value, Comparison comparison, List<?> in)`

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

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

### Method Detail

#### getValues

    public static List<?> getValues(Diff diff,
                                    IMergeViewer.MergeViewerSide side)

#### getFeatureValues

    public static List<?> getFeatureValues(Match match,
                                           EStructuralFeature feature,
                                           IMergeViewer.MergeViewerSide side)

#### getEObject

    public static EObject getEObject(Match match,
                                     IMergeViewer.MergeViewerSide side)

#### getBestSideEObject

    public static EObject getBestSideEObject(Match match,
                                             IMergeViewer.MergeViewerSide side)

#### getAffectedFeature

    public static EStructuralFeature getAffectedFeature(Diff diff)

#### getDiffValue

    public static Object getDiffValue(Diff diff)

Returns either `ReferenceChange.getValue()`, `AttributeChange.getValue()` or a `FeatureMapChange.getValue()` depending on the runtime type of the give `diff` or null otherwise.

Parameters:
  `diff` -
Returns:

#### getValueFromDiff

    public static Object getValueFromDiff(Diff diff,
                                          IMergeViewer.MergeViewerSide side)

#### getResource

    public static Resource getResource(Comparison comparison,
                                       IMergeViewer.MergeViewerSide side,
                                       Diff diff)

Returns the current resource on the given side of the given comparison.

Parameters:
  `comparison` - The given comparison.
  `side` - The given side.
  `diff` - The given diff (a `ResourceAttachmentChange`.
Returns:
  The current resource on the given side of the given comparison.

#### getResourceContents

    public static List<EObject> getResourceContents(Comparison comparison,
                                                    IMergeViewer.MergeViewerSide side,
                                                    Diff diff)

Returns the contents of the current resource on the given side of the given comparison.

Parameters:
  `comparison` - The given comparison.
  `side` - The given side.
Returns:
  The contents of the current resource on the given side of the given comparison.

#### getResourceAttachmentChangeValue

    public static Object getResourceAttachmentChangeValue(ResourceAttachmentChange diff,
                                                          IMergeViewer.MergeViewerSide side)

Parameters:
  `diff` -
  `side` -
Returns:

#### getValueFromResourceAttachmentChange

    public static Object getValueFromResourceAttachmentChange(ResourceAttachmentChange diff,
                                                              Comparison comparison,
                                                              IMergeViewer.MergeViewerSide side)

#### matchingValue

    public static Object matchingValue(Object object,
                                       Comparison comparison,
                                       IMergeViewer.MergeViewerSide side)

#### matchingValue

    public static Object matchingValue(Object value,
                                       Comparison comparison,
                                       List<?> in)

#### isVisibleInMergeViewer

    public static boolean isVisibleInMergeViewer(Diff diff,
                                                 IDifferenceGroupProvider groupProvider,
                                                 com.google.common.base.Predicate<? super EObject> predicate)

Returns true if the given diff is displayed in an group as provided by the `groupProvider` and not filtered by the given filter `predicate`.

Parameters:
  `diff` - the `Diff` to check.
  `groupProvider` - the `IDifferenceGroupProvider`.
  `predicate` - the filter `Predicate`.
Returns:
  `true` if the given `diff` is visible in the given `groupProvider`, `false` otherwise.

#### isMarkAsMerged

    public static boolean isMarkAsMerged(Diff diff,
                                         IMergeViewerItem item,
                                         IEMFCompareConfiguration compareConfiguration)

Checks if the given diff is considered as a mark as merged diff.

Parameters:
  `diff` - the given Diff.
  `item` - the given IMergeViewerItem associated with the diff.
  `compareConfiguration` - the compare configuration object to use with this viewer.
Returns:
  true, if the given diff is considered as a mark as merged diff, false otherwise.
See Also:
  `MergeOperation`