Using DifffTool to show multiple file diffs

Iam using DiffTool to show differences between files in a plugin that Iam writing. However Iam able to show only one diff at a time - whereas, the Idea diff tool seems to be able to show multiple file diffs - one can use the arrow buttons in the diff viewer to move between diffs. I assume Iam not setting the correct paramters? The following is the code Iam using.

SimpleDiffRequest request = new SimpleDiffRequest(project, "Diff");
request.setContentTitles("File 1", "File 2");
request.setContents(df1, df2);
DiffTool diffTool = DiffManager.getInstance().getIdeaDiffTool();
diffTool.show(request);

How can I modify this to show multiple file diffs in the same diff viewer?

2 comments
Comment actions Permalink

Hello Krishna,

DiffRequest itself doesn't support showing diffs for multiple files. The
buttons to move between different files are provided by external code, via
the request.setToolbarAddons() method. See the ChangeDiffRequest class in
the IDEA Community Edition source code to find out more about how it's implemented.

Iam using DiffTool to show differences between files in a plugin that
Iam writing. However Iam able to show only one diff at a time -
whereas, the Idea diff tool seems to be able to show multiple file
diffs - one can use the arrow buttons in the diff viewer to move
between diffs. I assume Iam not setting the correct paramters? The
following is the code Iam using.

SimpleDiffRequest request = new SimpleDiffRequest(project, "Diff");
request.setContentTitles("File 1", "File 2");
request.setContents(df1, df2);
DiffTool diffTool = DiffManager.getInstance().getIdeaDiffTool();
diffTool.show(request);
How can I modify this to show multiple file diffs in the same diff
viewer?

---
Original message URL:
http://www.jetbrains.net/devnet/message/5264941#5264941

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Yup. That seems perfect! Thanks.

0

Please sign in to leave a comment.