1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

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 <fmorgner@hsr.ch>
This commit is contained in:
Felix Morgner 2019-02-18 14:41:57 +01:00 committed by Jonah Graham
parent 97e18b4b31
commit 659432f7e2
2 changed files with 8 additions and 1 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true 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-Activator: org.eclipse.cdt.ui.CUIPlugin
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin

View file

@ -15,7 +15,9 @@
package org.eclipse.cdt.internal.ui.text.c.hover; package org.eclipse.cdt.internal.ui.text.c.hover;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Optional;
import org.eclipse.cdt.core.dom.ast.IASTFileLocation; import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
import org.eclipse.cdt.core.dom.ast.IMacroBinding; 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.IPath;
import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.layout.PixelConverter; import org.eclipse.jface.layout.PixelConverter;
@ -343,6 +346,10 @@ public class CMacroExpansionExplorationControl extends AbstractCompareViewerInfo
getShell().setSize(new Point(stringLengthInPixel, pt.y)); getShell().setSize(new Point(stringLengthInPixel, pt.y));
} }
} }
Optional.ofNullable(getToolBarManager()).ifPresent(mgr -> {
Arrays.stream(mgr.getItems()).forEach(IContributionItem::update);
});
} }
private void fillToolBar() { private void fillToolBar() {