From 659432f7e208d41461421200a098d19b15a0dbcc Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 18 Feb 2019 14:41:57 +0100 Subject: [PATCH] Bug 544535: Buttons in "Explore Macro Expansion" are not active Refresh the toolbar buttons after registering the command handlers, to make sure that they are active. Change-Id: Ibee71a54fff7be0325257d25247e4e73f8b09b2e Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=544535 Signed-off-by: Felix Morgner --- core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF | 2 +- .../ui/text/c/hover/CMacroExpansionExplorationControl.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF index c13fbb4bdd5..30b6fc52ed8 100644 --- a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF +++ b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true -Bundle-Version: 6.4.100.qualifier +Bundle-Version: 6.4.200.qualifier Bundle-Activator: org.eclipse.cdt.ui.CUIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java index a5224704305..becd410e827 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java @@ -15,7 +15,9 @@ package org.eclipse.cdt.internal.ui.text.c.hover; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; +import java.util.Optional; import org.eclipse.cdt.core.dom.ast.IASTFileLocation; import org.eclipse.cdt.core.dom.ast.IMacroBinding; @@ -43,6 +45,7 @@ import org.eclipse.core.commands.IHandler; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; +import org.eclipse.jface.action.IContributionItem; import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.layout.PixelConverter; @@ -343,6 +346,10 @@ public class CMacroExpansionExplorationControl extends AbstractCompareViewerInfo getShell().setSize(new Point(stringLengthInPixel, pt.y)); } } + + Optional.ofNullable(getToolBarManager()).ifPresent(mgr -> { + Arrays.stream(mgr.getItems()).forEach(IContributionItem::update); + }); } private void fillToolBar() {