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

# Class TreeMergeViewer

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

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

public class TreeMergeViewer extends AbstractTableOrTreeMergeViewer
A concrete implementation of `AbstractTableOrTreeMergeViewer` for TreeViewer.

Since:
  4.0

## Nested Class Summary

## Nested classes/interfaces inherited from class org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.AbstractTableOrTreeMergeViewer

`AbstractTableOrTreeMergeViewer.ElementComparer, AbstractTableOrTreeMergeViewer.MesureItemListener`

## 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
`TreeMergeViewer(org.eclipse.swt.widgets.Composite parent, IMergeViewer.MergeViewerSide side, ICompareColor.Provider colorProvider, IEMFCompareConfiguration compareConfiguration)`
Default constructor.

## Method Summary

Modifier and Type
Method
Description
`protected org.eclipse.swt.widgets.Control`
`createControl(org.eclipse.swt.widgets.Composite parent)`
Creates the primary control associated with this viewer.
`protected org.eclipse.jface.viewers.TreeViewer`
`createTreeViewer(org.eclipse.swt.widgets.Composite parent)`
Creates a new tree viewer.
`Object`
`getInput()`
`org.eclipse.jface.viewers.TreeViewer`
`getStructuredViewer()`
Returns the wrapped `StructuredViewer`.
`protected void`
`hookDispose()`
`protected void`
`inputChanged(Object input, Object oldInput)`
`void`
`refresh()`
Refreshes this viewer completely with information freshly obtained from this viewer's model.
`void`
`setExpandedState(Object elementOrTreePath, boolean expanded)`
Set the expanded state of the given element or tree path.

### Methods inherited from class org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.AbstractTableOrTreeMergeViewer

`handleDispose, handleEraseItemEvent, handlePaintItemEvent`

### Methods inherited from class org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.AbstractStructuredMergeViewer

`createAction, createContextMenu, fillContextMenu, getControl, getDiff, getSelection, setContentProvider, setLabelProvider, setSelection`

### Methods inherited from class org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.AbstractMergeViewer

`getCompareConfiguration, getDifferenceFilter, getDifferenceGroupProvider, getEffectiveSide, getSide, handleDifferenceFilterChange, handleDifferenceGroupProviderChange`

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

`getContentProvider, getLabelProvider, handleLabelProviderChanged, hookControl, labelProviderChanged, setInput`

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

`addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, 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.emf.compare.rcp.ui.mergeviewer.IMergeViewer

`setInput`

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

`addSelectionChangedListener, removeSelectionChangedListener, setSelection`

## Constructor Details

### TreeMergeViewer

public TreeMergeViewer(org.eclipse.swt.widgets.Composite parent, IMergeViewer.MergeViewerSide side, ICompareColor.Provider colorProvider, IEMFCompareConfiguration compareConfiguration)
Default constructor.

Parameters:
  `parent` - the parent widget of this viewer.
  `side` - the side of this viewer.
  `colorProvider` - the color provider to use with this viewer.
  `compareConfiguration` - the compare configuration object to use with this viewer.

## Method Details

### createControl

protected org.eclipse.swt.widgets.Control createControl(org.eclipse.swt.widgets.Composite parent)
Creates the primary control associated with this viewer.

Specified by:
  `createControl` in class `AbstractStructuredMergeViewer`
Parameters:
  `parent` - the parent widget of this viewer.
Returns:
  the created primary control associated with this viewer.
See Also:
  - `org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.AbstractMergeViewer#createControl(org.eclipse.swt.widgets.Composite)`

### createTreeViewer

protected org.eclipse.jface.viewers.TreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent)
Creates a new tree viewer.

Parameters:
  `parent` - the parent of the new tree viewer.
Returns:
  a new tree viewer.

### getStructuredViewer

public org.eclipse.jface.viewers.TreeViewer getStructuredViewer()
Returns the wrapped `StructuredViewer`.

Specified by:
  `getStructuredViewer` in class `AbstractStructuredMergeViewer`
Returns:
  the wrapped `StructuredViewer`.
See Also:
  - `org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.impl.ide.ui.internal.contentmergeviewer.AbstractMergeViewer#getStructuredViewer()`

### setExpandedState

public void setExpandedState(Object elementOrTreePath, boolean expanded)
Set the expanded state of the given element or tree path.

Parameters:
  `elementOrTreePath` - the given element or tree path.
  `expanded` - the expanded state .

### hookDispose

protected void hookDispose()

Specified by:
  `hookDispose` in class `AbstractStructuredMergeViewer`

### inputChanged

protected void inputChanged(Object input, Object oldInput)

Overrides:
  `inputChanged` in class `org.eclipse.jface.viewers.Viewer`
See Also:
  - `Viewer.inputChanged(java.lang.Object, java.lang.Object)`

### getInput

public Object getInput()

Specified by:
  `getInput` in interface `org.eclipse.jface.viewers.IInputProvider`
Overrides:
  `getInput` in class `org.eclipse.jface.viewers.ContentViewer`
See Also:
  - `IInputProvider.getInput()`

### refresh

public void refresh()
Refreshes this viewer completely with information freshly obtained from this viewer's model.

Specified by:
  `refresh` in interface `IMergeViewer`
Specified by:
  `refresh` in class `org.eclipse.jface.viewers.Viewer`
See Also:
  - `Viewer.refresh()`