Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Morgner2019-02-18 13:41:57 +0000
committerJonah Graham2019-03-04 01:35:46 +0000
commitb94a0b5e0c81945f558a6ffb51ca844453b88eba (patch)
tree81e544a7e3756478ae14fb710474b1c7567422e8
parent2bb6839c1ad236c4f733e271885a86e396bfc956 (diff)
downloadorg.eclipse.cdt-b94a0b5e0c81945f558a6ffb51ca844453b88eba.tar.gz
org.eclipse.cdt-b94a0b5e0c81945f558a6ffb51ca844453b88eba.tar.xz
org.eclipse.cdt-b94a0b5e0c81945f558a6ffb51ca844453b88eba.zip
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 <fmorgner@hsr.ch>
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java7
1 files changed, 7 insertions, 0 deletions
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 a522470430..becd410e82 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() {

Back to the top