--- a/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java Fri Feb 12 16:42:00 2010 +0100 +++ a/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java Fri Feb 12 17:12:37 2010 +0100 @@ -106,6 +106,9 @@ /** Action constant for Toggle Breakpoint Action. */ public static final Object ACTION_TOGGLE_BREAKPOINT = "toggleBreakpoint"; + /** Action constant for Add Watch Action. */ + public static final Object ACTION_ADD_WATCH = "addWatch"; + // variables ............................................................... --- a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/AddWatchAction.java Fri Feb 12 16:42:00 2010 +0100 +++ a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/AddWatchAction.java Fri Feb 12 17:12:37 2010 +0100 @@ -45,6 +45,8 @@ import java.util.ResourceBundle; import java.util.prefs.Preferences; import javax.swing.*; +import org.netbeans.api.debugger.ActionsManager; +import org.netbeans.api.debugger.DebuggerEngine; import org.netbeans.api.debugger.DebuggerManager; import org.netbeans.modules.debugger.ui.WatchPanel; @@ -101,6 +103,9 @@ } public void performAction () { + if (performEngineAddWatchAction()) { + return ; + } ResourceBundle bundle = NbBundle.getBundle (AddWatchAction.class); WatchPanel wp = new WatchPanel (watchHistory); @@ -160,4 +165,16 @@ String viewName = VariablesViewButtons.isWatchesViewNested() ? "localsView" : "watchesView"; ViewActions.openComponent (viewName, false).requestVisible(); } + + private boolean performEngineAddWatchAction() { + DebuggerEngine engine = DebuggerManager.getDebuggerManager().getCurrentEngine(); + if (engine != null) { + ActionsManager manager = engine.getActionsManager(); + if (manager.isEnabled(ActionsManager.ACTION_ADD_WATCH)) { + manager.postAction(ActionsManager.ACTION_ADD_WATCH); + return true; + } + } + return false; + } }