1 11 package org.eclipse.debug.internal.ui.actions.expressions; 12 13 14 import java.util.Iterator ; 15 16 import org.eclipse.debug.core.model.IDebugElement; 17 import org.eclipse.debug.core.model.IWatchExpression; 18 import org.eclipse.jface.action.IAction; 19 import org.eclipse.jface.viewers.ISelection; 20 21 25 public class ReevaluateWatchExpressionAction extends WatchExpressionAction { 26 27 30 public void run(IAction action) { 31 IDebugElement context = getContext(); 32 for (Iterator iter= getCurrentSelection().iterator(); iter.hasNext();) { 33 IWatchExpression expression= (IWatchExpression) iter.next(); 34 expression.setExpressionContext(context); 35 if (!expression.isEnabled()) { 36 expression.evaluate(); 38 } 39 } 40 } 41 42 45 public void selectionChanged(IAction action, ISelection selection) { 46 IDebugElement debugElement = getContext(); 47 if (debugElement == null) { 48 action.setEnabled(false); 49 } else { 50 action.setEnabled(true); 51 } 52 } 53 54 } 55 | Popular Tags |