public abstract class DiffVisualizer extends Object
The registered Diff Visualizers can be obtained via Lookup
(e.g. you can get the default diff provider by
Lookup.getDefault().lookup(DiffVisualizer.class)
)
Constructor and Description |
---|
DiffVisualizer() |
Modifier and Type | Method and Description |
---|---|
DiffView |
createDiff(Difference[] diffs,
StreamSource s1,
StreamSource s2)
Creates single-window diff component that does not include any navigation controls and
is controlled programatically via the returned DiffView interface.
|
abstract Component |
createView(Difference[] diffs,
String name1,
String title1,
Reader r1,
String name2,
String title2,
Reader r2,
String MIMEType)
Show the visual representation of the diff between two sources.
|
public abstract Component createView(Difference[] diffs, String name1, String title1, Reader r1, String name2, String title2, Reader r2, String MIMEType) throws IOException
diffs
- The list of differences.name1
- the name of the first sourcetitle1
- the title of the first sourcer1
- the first sourcename2
- the name of the second sourcetitle2
- the title of the second sourcer2
- the second resource compared with the first one.MIMEType
- the mime type of these sourcesIOException
- when the reading from input streams fails.public DiffView createDiff(Difference[] diffs, StreamSource s1, StreamSource s2) throws IOException
The StreamSource can be used to save the source content if it's modified
in the view. The view should not allow source modification if StreamSource.createWriter()
returns null
.
diffs
- The list of differences.s1
- the first sources2
- the second sourceIOException