# Class ViewerDescriptor

java.lang.Object
org.eclipse.compare.internal.ViewerDescriptor

All Implemented Interfaces:
  `IViewerDescriptor`

public class ViewerDescriptor extends Object implements IViewerDescriptor
Creates `Viewer`s from an `IConfigurationElement`.

## Constructor Summary

Constructors
Constructor
Description
`ViewerDescriptor(IConfigurationElement config)`

## Method Summary

Modifier and Type
Method
Description
`Viewer`
`createViewer(Viewer currentViewer, Composite parent, CompareConfiguration mp)`
Creates a new viewer from this descriptor under the given STW parent control.
`String`
`getExtension()`
`String`
`toString()`

### Methods inherited from class Object

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

## Constructor Details

### ViewerDescriptor

public ViewerDescriptor(IConfigurationElement config)

## Method Details

### createViewer

public Viewer createViewer(Viewer currentViewer, Composite parent, CompareConfiguration mp)
Description copied from interface: `IViewerDescriptor`
Creates a new viewer from this descriptor under the given STW parent control. If the current viewer has the same type as a new viewer the implementation of this method is free to return the current viewer instead.

Specified by:
  `createViewer` in interface `IViewerDescriptor`
Parameters:
  `currentViewer` - the current viewer which is going to be replaced with a new viewer.
  `parent` - the SWT parent control under which the new viewer has to be created.
  `mp` - a compare configuration the new viewer might be interested in.
Returns:
  a new viewer or the current viewer.

### getExtension

public String getExtension()

### toString

public String toString()

Overrides:
  `toString` in class `Object`