1 11 package org.eclipse.debug.internal.ui.actions; 12 13 14 import org.eclipse.debug.core.DebugPlugin; 15 import org.eclipse.debug.core.model.IWatchExpression; 16 import org.eclipse.debug.internal.ui.DebugUIPlugin; 17 import org.eclipse.jface.action.IAction; 18 import org.eclipse.jface.viewers.ISelection; 19 import org.eclipse.jface.window.Window; 20 import org.eclipse.ui.IViewActionDelegate; 21 import org.eclipse.ui.IViewPart; 22 23 27 public class AddWatchExpressionAction extends WatchExpressionAction implements IViewActionDelegate { 28 29 32 public void init(IViewPart view) { 33 } 34 35 38 public void run(IAction action) { 39 IWatchExpression watchExpression= DebugPlugin.getDefault().getExpressionManager().newWatchExpression(""); if (new WatchExpressionDialog(DebugUIPlugin.getShell(), watchExpression, false).open() == Window.OK) { 43 DebugPlugin.getDefault().getExpressionManager().addExpression(watchExpression); 45 watchExpression.setExpressionContext(getContext()); 46 } 47 } 48 49 52 public void selectionChanged(IAction action, ISelection selection) { 53 } 54 55 } 56 | Popular Tags |