blob: c2282181927200ad2f9ab7f9a2f1edd9519147dd [file]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<TITLE>Merging multiple streams</TITLE>
<link rel="stylesheet" type="text/css" HREF="../book.css">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2>
Merging multiple streams</H2>
<p>
The search plug-in allows you to customize views that assist the user in merging different
content streams. In some cases, however, the ability to merge streams without the assist of a user
is desirable. The extension point
<a href="../reference/extension-points/org_eclipse_compare_streamMergers.html"><b>org.eclipse.compare.streamMergers</b></a>
allows you to contribute a class that merges three different input streams into a single output stream. Stream mergers
can be associated with file extensions or bound to a particular content type. The search plug-in defines a stream
merger for merging three streams of plain text:</p>
<pre>&lt;extension
point="org.eclipse.compare.streamMergers"&gt;
&lt;streamMerger
extensions="txt"
class="org.eclipse.compare.internal.merge.TextStreamMerger"
id="org.eclipse.compare.internal.merge.TextStreamMerger"&gt;
&lt;/streamMerger>
&lt;contentTypeBinding
contentTypeId="org.eclipse.core.runtime.text"
streamMergerId="org.eclipse.compare.internal.merge.TextStreamMerger"&gt;
&lt;/contentTypeBinding&gt;
&lt;/extension&gt;
</pre>
<p>The stream merger itself is described in the <b>streamMerger</b> element. You must specify the <b>id </b>of the
merger and the <b>class</b> that implements it. You may also specify any file <b>extensions</b> for which the
the stream merger should be used.</p>
<p>You may also use the <b>contentTypeBinding</b> element to associate a <a href="runtime_content.htm">content type</a>
with a stream merger.
</p>
<p>
Stream mergers must implement
<a href="../reference/api/org/eclipse/compare/IStreamMerger.html"><b>IStreamMerger</b></a>.
This simple interface merges the contents from three different input streams into a single output stream.
The not-so-simple implementation depends upon your plug-in and its content types.
</p>
<p>
New <a href="../reference/api/org/eclipse/compare/IStreamMerger.html"><b>IStreamMerger</b></a>s
can be created for registered types with the createStreamMerger methods of <a href="../reference/api/org/eclipse/compare/CompareUI.html"><b>CompareUI</b></a>.
</p>
</BODY>
</HTML>