Fix display of "Show Revision Information" in editors
commitc72723a3407f343a40d66532680b1cbcb30d1169
authorThomas Wolf <thomas.wolf@paranor.ch>
Fri, 14 Oct 2016 21:27:16 +0000 (14 23:27 +0200)
committerThomas Wolf <thomas.wolf@paranor.ch>
Fri, 14 Oct 2016 21:41:19 +0000 (14 23:41 +0200)
tree4b4014d13e966fb52d696c9a343be47d98fed128
parent417bbc5f91fe188550ab948211ffc1cb684b8f50
Fix display of "Show Revision Information" in editors

The context menu was missing from editors opened from the history
view's file list (Context menu->Show Revision Information would
open an editor and show the annotations, but when these were then
hidden, they could not be re-displayed from within the editor).
Moreover, opening a file version from the history view (Context
menu->Open This Version) would open an editor that would have the
"Show Revision Information" context menu, but when invoked it would
open up yet another editor.

The root cause is explained in bug 505938, comment 2. Basically we
end up with different FileRevisionEditorInput classes being used for
editors, one from EGit, and an internal one from org.eclipse.ui.team.

Fix this by refactoring the blame machinery in EGit UI to work either
with IFile or with CommitFileRevision. and make sure to use
EgitEditorUtils.openEditor() instead of
RevisionAnnotationController.openEditor().

Bug: 505938
Change-Id: Ie9d857ee469f93e8df3d8b6cc386c410394ccc29
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/EgitUiEditorUtils.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowBlameActionHandler.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameOperation.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ShowBlameHandler.java