Refactor the action handling in the git history view
Commit
bc712de04 broke the handling of global actions. The git history
view has three viewers, each with their own actions (and context menus).
Each called updateActionBars() to register and unregister global
actions when it got or lost the focus. This interfered badly with the
new dynamic search toolbar item because updateActionBars() also updates
the toolbar and re-creates that dynamic item every time. However, the
change made in
bc712de04 was not correct; global action registrations
were no longer propagated to the RetargetActions.
Introduce a new class ActionUtils for the creation and registration of
global actions provided by widgets. Register and unregister actions via
the global IHandlerService. This gets rid of duplicated code in the
three viewer classes, updates only the global action handlers but not
the toolbar, and also enables the accelerators for these commands in
the CommitEditorPage and StashEditorPage.
Finally use getPath() instead of getNewPath() in the copy implementation
in CommitFileDiffViewer so that it also works for deleted files.
Bug: 503198
Change-Id: I0ee88c4f03f5fbcab86099cc498c68a2b077b1fa
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>