/** * 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 <code>null</code> is returned. * * @param oldViewer a new viewer is only created if this old viewer cannot show the given input * @param in the input object for which to find a content viewer * @param parent the SWT parent composite under which the new viewer is created * @param cc a configuration which is passed to a newly created viewer * @return the compare viewer which is suitable for the given input object or <code>null</code> */ public Viewer findContentViewer(Viewer oldViewer, Object in, Composite parent, CompareConfiguration cc) { ViewerDescriptor[] descriptors = findContentViewerDescriptor(oldViewer, in, cc); return getViewer(descriptors != null ? descriptors[0] : null, oldViewer, parent, cc); }
if (ct != null) { initializeRegistries(); Viewer viewer= getViewer(fContentViewers.search(ct), oldViewer, parent, cc); if (viewer != null) return viewer; Viewer viewer= getViewer(fContentViewers.search(type), oldViewer, parent, cc); if (viewer != null) return viewer; Viewer viewer= getViewer(fContentMergeViewers.search(ctype), oldViewer, parent, cc); if (viewer != null) return viewer; Viewer viewer= getViewer(fContentMergeViewers.search(type), oldViewer, parent, cc); if (viewer != null) return viewer;
return getViewer(descriptors[0], oldViewer, parent, configuration);
if (ctype != null) { initializeRegistries(); Viewer viewer= getViewer(fStructureMergeViewers.search(ctype), oldViewer, parent, configuration); if (viewer != null) return viewer;