ktisha/Crucible4IDEA — pull request #37 by klikh (2013-04-19 17:10:46+00:00)
Title: #36 Fix adding and showing comments for the diff chain

When Show Diff is called on a file from a commit, the DiffTool is
shown only once, therefore any data (VirtualFile) requested at this
time, and any modifications to the tool (addComment, addGutter)
will be lost when user moves to the next or previous file
in the diff chain.

1. To customize the diff panel for each Change, we need to extend the
DiffPanel. Override the new protected method from the FrameDiffTool:
create a DiffPanelImpl extension that adds comment icons to the
gutter and adds an action to create a new comment.

2. By moving addCommentAction & addGutter to the DiffPanelImpl
extension, we can no more override the show() method which has some
complex logic partly copy-pasted here.

3. Get the VirtualFile not from the DataContext (it would return the
VF selected by user before calling Show Diff), but from the diff chain.

4. In addCommentAction get the filepath from the virtual file,
not from the revision (because the revision only for the first file
in the chain is passed there).