Class CompareUI

The class CompareUI defines the entry point to initiate a configurable
compare operation on arbitrary resources. The result of the compare
is opened into a compare editor where the details can be browsed and
edited in dynamically selected structure and content viewers.

The Compare UI provides a registry for content and structure compare viewers,
which is initialized from extensions contributed to extension points
declared by this plug-in.

getImage

Returns a shared image for the given adaptable.
This convenience method queries the given adaptable
for its IWorkbenchAdapter.getImageDescriptor, which it
uses to create an image if it does not already have one.

Note: Images returned from this method will be automatically disposed
of when this plug-in shuts down. Callers must not dispose of these
images themselves.

findStructureViewer

Returns a structure compare viewer based on an old viewer and an input object.
If the old viewer is suitable for showing the input, the old viewer
is returned. Otherwise, the input's type is used to find a viewer descriptor in the registry
which in turn is used to create a structure compare viewer under the given parent composite.
If no viewer descriptor can be found null is returned.

Parameters:

oldViewer - a new viewer is only created if this old viewer cannot show the given input

input - the input object for which to find a structure viewer

parent - the SWT parent composite under which the new viewer is created

configuration - a configuration which is passed to a newly created viewer

Returns:

the compare viewer which is suitable for the given input object or null

findContentViewer

Returns a content compare viewer based on an old viewer and an input object.
If the old viewer is suitable for showing the input the old viewer
is returned. Otherwise the input's type is used to find a viewer descriptor in the registry
which in turn is used to create a content compare viewer under the given parent composite.
If no viewer descriptor can be found null is returned.

Parameters:

oldViewer - a new viewer is only created if this old viewer cannot show the given input

input - the input object for which to find a content viewer

parent - the SWT parent composite under which the new viewer is created

configuration - a configuration which is passed to a newly created viewer

Returns:

the compare viewer which is suitable for the given input object or null

findContentViewer

Returns a content compare viewer based on an old viewer and an input
object. If the old viewer is suitable for showing the input the old
viewer is returned. Otherwise the input's type is used to find a viewer
descriptor in the registry which in turn is used to create a content
compare viewer under the given parent composite. In order to determine
the input's type, the input must either implement IStreamContentAccessor
and ITypedElement or ICompareInput. If no viewer descriptor can be found
null is returned.

Parameters:

oldViewer - a new viewer is only created if this old viewer cannot show the given input

input - the input object for which to find a content viewer. Must
implement either IStreamContentAccessor and
ITypedElement or ICompareInput.

parent - the SWT parent composite under which the new viewer is created

configuration - a configuration which is passed to a newly created viewer

Returns:

the compare viewer which is suitable for the given input object or null