CommitFileDiffViewer: command handlers for the context menu (part I) (details)
Commit
1ef1e012c1b31b82ed376ca9f929c4a929ed2c2d
by Thomas Wolf
CommitFileDiffViewer: command handlers for the context menu (part I)
Make the context menu of the CommitFileDiffViewer extensible, and migrate the first three hard-coded Actions to Command handlers. Define the menu extension in plugin.xml.
Using menu extensions requires having the current selection reported by the view set correctly depending on which viewer in the GitHistoryPage is focused. Use a MultiViewerSelectionProvider; this tracks focus are reports the selection of the focused viewer.
A new FileDiffPropertyTester is needed to express activation/enablement correctly in plugin.xml.
Update the CommitEditor and its pages similarly so that they report the selection from the currently focused viewer.
Unify the two "blame" commands; just use one single command with different handlers.
Follow-up commits will migrate the remaining actions from that context menu to command handlers, and then we re-use the new command handlers in the DifFEditorOutlinePage, which shows objects that can adapt to FileDiff.