Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2020-10-05 19:27:02 +0000
committerThomas Wolf2020-10-05 19:27:02 +0000
commit935ccb0ffd6957fe39accf13cede0184688d1a53 (patch)
treee11f40e73dae5c3596a2f51b5fc6ab2e7a160f78
parent47be7c3c461412a85b087df105fd9393418978a8 (diff)
downloadegit-master.tar.gz
egit-master.tar.xz
egit-master.zip
[history page] Key binding for the refresh actionHEADmaster
Register the refresh action as the global refresh action so that the configured key binding (F5 by default) works. The tooltip on the toolbar button doesn't show the bound key, though. The GenericHistoryView has its own refresh action, which is not registered for the global retarget action. Doing so there might be another way to fix this in org.eclipse.team.ui, but may have unknown effects on other history pages but the EGit one. Bug: 567600 Change-Id: I3a8cde955d6bf024db097df57c1465681ea0c7cc Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
index 58125d6ed1..383f60ba7d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
@@ -487,6 +487,8 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
wrapCommentAction.setEnabled(showCommentAction.isChecked());
fillCommentAction.setEnabled(showCommentAction.isChecked());
+ historyPage.getSite().getActionBars().updateActionBars();
+
}
private void createRepositorySwitchAction() {
@@ -547,17 +549,26 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
findAction.setChecked(isChecked);
historyPage.getSite().getActionBars().setGlobalActionHandler(
ActionFactory.FIND.getId(), findAction);
- historyPage.getSite().getActionBars().updateActionBars();
}
private void createRefreshAction() {
+ // Unfortunately we have no access to the refresh action the
+ // GenericHistoryView puts into the toolbar. Define our own
+ // so we can put it into the view menu and set it as a global
+ // handler for the global retarget action to get the keybinding
+ // to work.
refreshAction = new Action(UIText.GitHistoryPage_RefreshMenuLabel,
UIIcons.ELCL16_REFRESH) {
+
@Override
public void run() {
historyPage.refresh();
}
};
+ refreshAction.setActionDefinitionId(
+ IWorkbenchCommandConstants.FILE_REFRESH);
+ historyPage.getSite().getActionBars().setGlobalActionHandler(
+ ActionFactory.REFRESH.getId(), refreshAction);
}
private void createFilterActions() {

Back to the top