diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index ab3d5286c13..4ccb28bc640 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -1328,7 +1328,7 @@ + locationURI="toolbar:org.eclipse.debug.ui.DebugView?endof=togInstStepModeGroup"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -355,6 +291,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -444,6 +480,10 @@ + + @@ -635,6 +675,10 @@ description="%command.jumpToMemory.description" id="org.eclipse.cdt.debug.ui.memory.memorybrowser.jumpToMemory" name="%command.jumpToMemory.name"/> + + diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/RefreshActionDelegate.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/RefreshActionDelegate.java deleted file mode 100644 index d763320b68f..00000000000 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/RefreshActionDelegate.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Wind River Systems - initial API and implementation - * Texas Instruments - Bug 340478 - *******************************************************************************/ -package org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.actions; - -import org.eclipse.cdt.dsf.debug.ui.viewmodel.actions.AbstractVMProviderActionDelegate; -import org.eclipse.cdt.dsf.debug.ui.viewmodel.actions.VMHandlerUtils; -import org.eclipse.cdt.dsf.ui.viewmodel.IVMProvider; -import org.eclipse.cdt.dsf.ui.viewmodel.update.ICachingVMProvider; -import org.eclipse.debug.ui.contexts.DebugContextEvent; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IViewPart; - -/** - * - */ -public class RefreshActionDelegate extends AbstractVMProviderActionDelegate { - - @Override - public void run(IAction action) { - IVMProvider provider = VMHandlerUtils.getVMProviderForPart(getView()); - if (provider instanceof ICachingVMProvider) { - ((ICachingVMProvider) provider).refresh(); - } - } - - @Override - public void init(IViewPart view) { - super.init(view); - IVMProvider vp = VMHandlerUtils.getVMProviderForPart(getView()); - getAction().setEnabled(vp instanceof ICachingVMProvider); - } - - @Override - public void debugContextChanged(DebugContextEvent event) { - super.debugContextChanged(event); - IVMProvider vp = VMHandlerUtils.getVMProviderForPart(getView()); - getAction().setEnabled(vp instanceof ICachingVMProvider); - } - - @Override - public void selectionChanged(IAction action, ISelection selection) { - super.selectionChanged(action, selection); - IVMProvider vp = VMHandlerUtils.getVMProviderForPart(getView()); - getAction().setEnabled(vp instanceof ICachingVMProvider); - } -} diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/ViewRefreshHandler.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/ViewRefreshHandler.java new file mode 100644 index 00000000000..b2a9165a9f0 --- /dev/null +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/ViewRefreshHandler.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2025 Advantest Europe GmbH and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Raghunandana Murthappa + *******************************************************************************/ +package org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.actions; + +import org.eclipse.cdt.dsf.debug.ui.viewmodel.actions.VMHandlerUtils; +import org.eclipse.cdt.dsf.ui.viewmodel.IVMProvider; +import org.eclipse.cdt.dsf.ui.viewmodel.update.ICachingVMProvider; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * Handler that handles the 'Refresh' toolbar contribution item that is present on all debug views. + * + * @author Raghunandana Murthappa + */ +public class ViewRefreshHandler extends AbstractHandler { + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IWorkbenchPart activePart = HandlerUtil.getActivePart(event); + if (activePart instanceof IViewPart view) { + IVMProvider provider = VMHandlerUtils.getVMProviderForPart(view); + if (provider instanceof ICachingVMProvider cachingVmProvider) { + cachingVmProvider.refresh(); + } + } + return IStatus.OK; + } +}