diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/plugin.properties b/plugins/org.eclipse.dd.dsf.debug.ui/plugin.properties index cb75b8ddd18..24101fd74a3 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/plugin.properties +++ b/plugins/org.eclipse.dd.dsf.debug.ui/plugin.properties @@ -40,7 +40,7 @@ action.expandStack.label = E&xpand Stack action.refreshAll.name=Refresh Debug Views -command.refresh.name=Refresh +action.refresh.label=Refresh # Preferences diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/plugin.xml b/plugins/org.eclipse.dd.dsf.debug.ui/plugin.xml index 01ec790dfd5..b43b75c3a16 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/plugin.xml +++ b/plugins/org.eclipse.dd.dsf.debug.ui/plugin.xml @@ -55,6 +55,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -77,18 +131,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/ui/viewmodel/actions/RefreshActionDelegate.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/ui/viewmodel/actions/RefreshActionDelegate.java new file mode 100644 index 00000000000..b5805b6771d --- /dev/null +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/ui/viewmodel/actions/RefreshActionDelegate.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2007, 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.dsf.debug.internal.ui.viewmodel.actions; + +import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions.AbstractVMProviderActionDelegate; +import org.eclipse.dd.dsf.ui.viewmodel.IVMProvider; +import org.eclipse.dd.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 { + + public void run(IAction action) { + IVMProvider provider = getVMProvider(); + if (provider instanceof ICachingVMProvider) { + ((ICachingVMProvider)provider).refresh(); + } + } + + @Override + public void init(IViewPart view) { + super.init(view); + getAction().setEnabled(getVMProvider() instanceof ICachingVMProvider); + } + + @Override + public void debugContextChanged(DebugContextEvent event) { + super.debugContextChanged(event); + getAction().setEnabled(getVMProvider() instanceof ICachingVMProvider); + } + + @Override + public void selectionChanged(IAction action, ISelection selection) { + super.selectionChanged(action, selection); + getAction().setEnabled(getVMProvider() instanceof ICachingVMProvider); + } +}