From b5b679b3f5d73e896e306f3ca81aa569a8f2fc1b Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Sun, 11 Dec 2016 21:39:12 +0100 Subject: [PATCH] Enable the text editor toolbar items for DiffEditorPage A TextEditor provides a couple of items in an action set in the global Eclipse toolbar: buttons for block selection, word wrap, showing whitespace, and navigation between annotations. As the DiffEditorPage is a real TextEditor now, enable those. * Add an "action set part association" in plugin.xml to get those buttons at all when the CommitEditor is active. * Propagate the global action contributions from the nested editor's SubActionBars to those of the CommitEditor. Change-Id: I516b5609906aefb6840bc9f4f4e95d92fafc1590 Signed-off-by: Thomas Wolf --- org.eclipse.egit.ui/plugin.xml | 9 +++++++++ .../eclipse/egit/ui/internal/commit/CommitEditor.java | 9 ++++----- .../commit/CommitEditorActionBarContributor.java | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml index 63ff44dcb..96f7286c8 100644 --- a/org.eclipse.egit.ui/plugin.xml +++ b/org.eclipse.egit.ui/plugin.xml @@ -5989,6 +5989,15 @@ + + + + + + handlers = textEditorBars.getGlobalActionHandlers(); + if (handlers != null) { + for (Map.Entry entry : handlers.entrySet()) { + Object key = entry.getKey(); + Object value = entry.getValue(); + if (key instanceof String && value instanceof IAction) { + rootBars.setGlobalActionHandler((String) key, + (IAction) value); + } + } + } } else { textEditorBars.deactivate(); } -- 2.11.4.GIT