Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 8d69626db574b843cd7bac9ae4bc30fde42431e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
package org.eclipse.compare.internal;

import org.eclipse.swt.widgets.Composite;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.compare.CompareConfiguration;

/**
 * A factory object for creating a <code>Viewer</code>s from a descriptor.
 * <p>
 * It is used when registering a viewer for a specific type
 * in <code>CompareUIPlugin.registerContentViewerDescriptor</code> and
 * in <code>CompareUIPlugin.registerStructureViewerDescriptor</code>.
 *
 * @see org.eclipse.compare.structuremergeviewer.IStructureCreator
 * @see CompareUIPlugin
 */
public 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.
	 *
	 * @param currentViewer the current viewer which is going to be replaced with a new viewer.
	 * @param parent the SWT parent control under which the new viewer has to be created.
	 * @param config a compare configuration the new viewer might be interested in.
	 * @return a new viewer or the current viewer.
	 */
	Viewer createViewer(Viewer currentViewer, Composite parent, CompareConfiguration config);
}

Back to the top