Package org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.tree

# Class TreeContentMergeViewerContentProvider

java.lang.Object
org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.tree.TreeContentMergeViewerContentProvider

All Implemented Interfaces:
  `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`, `org.eclipse.jface.viewers.IContentProvider`

public class TreeContentMergeViewerContentProvider extends Object implements org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider
An `IMergeViewerContentProvider` that delegates `getXXXImage(Object)` and `getXXXText()` to a `CompareConfiguration`.

`getXXXContent()` is computed by getting the side form the given object or from its parent if null, recursively.

## Constructor Summary

Constructors
Constructor
Description
`TreeContentMergeViewerContentProvider(EMFCompareConfiguration cc)`
Creates a new `TreeContentMergeViewerContentProvider` and stored the given `CompareConfiguration`.

## Method Summary

Modifier and Type
Method
Description
`void`
`dispose()`
`Object`
`getAncestorContent(Object element)`
`org.eclipse.swt.graphics.Image`
`getAncestorImage(Object element)`
`String`
`getAncestorLabel(Object element)`
`Object`
`getLeftContent(Object element)`
`org.eclipse.swt.graphics.Image`
`getLeftImage(Object element)`
`String`
`getLeftLabel(Object element)`
`Object`
`getRightContent(Object element)`
`org.eclipse.swt.graphics.Image`
`getRightImage(Object element)`
`String`
`getRightLabel(Object element)`
`void`
`inputChanged(org.eclipse.jface.viewers.Viewer v, Object o1, Object o2)`
`boolean`
`isLeftEditable(Object element)`
`boolean`
`isRightEditable(Object element)`
`void`
`saveLeftContent(Object element, byte[] bytes)`
`void`
`saveRightContent(Object element, byte[] bytes)`
`boolean`
`showAncestor(Object element)`

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

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

## Constructor Details

### TreeContentMergeViewerContentProvider

public TreeContentMergeViewerContentProvider(EMFCompareConfiguration cc)
Creates a new `TreeContentMergeViewerContentProvider` and stored the given `CompareConfiguration`.

Parameters:
  `cc` - the `CompareConfiguration` that will be used to get label and image of left, right and ancestor.
  `comparison` - the comparison that is to be displayed by this viewer.

## Method Details

### dispose

public void dispose()

Specified by:
  `dispose` in interface `org.eclipse.jface.viewers.IContentProvider`
See Also:
  - `IContentProvider.dispose()`

### inputChanged

public void inputChanged(org.eclipse.jface.viewers.Viewer v, Object o1, Object o2)

Specified by:
  `inputChanged` in interface `org.eclipse.jface.viewers.IContentProvider`
See Also:
  - `IContentProvider.inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)`

### getAncestorLabel

public String getAncestorLabel(Object element)

Specified by:
  `getAncestorLabel` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.getAncestorLabel(java.lang.Object)`

### getAncestorImage

public org.eclipse.swt.graphics.Image getAncestorImage(Object element)

Specified by:
  `getAncestorImage` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.getAncestorImage(java.lang.Object)`

### getAncestorContent

public Object getAncestorContent(Object element)

Specified by:
  `getAncestorContent` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`

### showAncestor

public boolean showAncestor(Object element)

Specified by:
  `showAncestor` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.showAncestor(java.lang.Object)`

### getLeftLabel

public String getLeftLabel(Object element)

Specified by:
  `getLeftLabel` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.getLeftLabel(java.lang.Object)`

### getLeftImage

public org.eclipse.swt.graphics.Image getLeftImage(Object element)

Specified by:
  `getLeftImage` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.getLeftImage(java.lang.Object)`

### getLeftContent

public Object getLeftContent(Object element)

Specified by:
  `getLeftContent` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`

### isLeftEditable

public boolean isLeftEditable(Object element)

Specified by:
  `isLeftEditable` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.isLeftEditable(java.lang.Object)`

### saveLeftContent

public void saveLeftContent(Object element, byte[] bytes)

Specified by:
  `saveLeftContent` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.saveLeftContent(java.lang.Object, byte[])`

### getRightLabel

public String getRightLabel(Object element)

Specified by:
  `getRightLabel` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.getRightLabel(java.lang.Object)`

### getRightImage

public org.eclipse.swt.graphics.Image getRightImage(Object element)

Specified by:
  `getRightImage` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.getRightImage(java.lang.Object)`

### getRightContent

public Object getRightContent(Object element)

Specified by:
  `getRightContent` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`

### isRightEditable

public boolean isRightEditable(Object element)

Specified by:
  `isRightEditable` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.isRightEditable(java.lang.Object)`

### saveRightContent

public void saveRightContent(Object element, byte[] bytes)

Specified by:
  `saveRightContent` in interface `org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider`
See Also:
  - `IMergeViewerContentProvider.saveRightContent(java.lang.Object, byte[])`