This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 180558
Collapse All | Expand All

(-)a/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java (+3 lines)
Lines 106-111 Link Here
106
    /** Action constant for Toggle Breakpoint Action. */
106
    /** Action constant for Toggle Breakpoint Action. */
107
    public static final Object              ACTION_TOGGLE_BREAKPOINT = "toggleBreakpoint";
107
    public static final Object              ACTION_TOGGLE_BREAKPOINT = "toggleBreakpoint";
108
    
108
    
109
    /** Action constant for Add Watch Action. */
110
    public static final Object              ACTION_ADD_WATCH = "addWatch";
111
109
    
112
    
110
    // variables ...............................................................
113
    // variables ...............................................................
111
    
114
    
(-)a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/AddWatchAction.java (+17 lines)
Lines 45-50 Link Here
45
import java.util.ResourceBundle;
45
import java.util.ResourceBundle;
46
import java.util.prefs.Preferences;
46
import java.util.prefs.Preferences;
47
import javax.swing.*;
47
import javax.swing.*;
48
import org.netbeans.api.debugger.ActionsManager;
49
import org.netbeans.api.debugger.DebuggerEngine;
48
import org.netbeans.api.debugger.DebuggerManager;
50
import org.netbeans.api.debugger.DebuggerManager;
49
import org.netbeans.modules.debugger.ui.WatchPanel;
51
import org.netbeans.modules.debugger.ui.WatchPanel;
50
52
Lines 101-106 Link Here
101
    }
103
    }
102
    
104
    
103
    public void performAction () {
105
    public void performAction () {
106
        if (performEngineAddWatchAction()) {
107
            return ;
108
        }
104
        ResourceBundle bundle = NbBundle.getBundle (AddWatchAction.class);
109
        ResourceBundle bundle = NbBundle.getBundle (AddWatchAction.class);
105
110
106
        WatchPanel wp = new WatchPanel (watchHistory);
111
        WatchPanel wp = new WatchPanel (watchHistory);
Lines 160-163 Link Here
160
        String viewName = VariablesViewButtons.isWatchesViewNested() ? "localsView" : "watchesView";
165
        String viewName = VariablesViewButtons.isWatchesViewNested() ? "localsView" : "watchesView";
161
        ViewActions.openComponent (viewName, false).requestVisible();
166
        ViewActions.openComponent (viewName, false).requestVisible();
162
    }
167
    }
168
169
    private boolean performEngineAddWatchAction() {
170
        DebuggerEngine engine = DebuggerManager.getDebuggerManager().getCurrentEngine();
171
        if (engine != null) {
172
            ActionsManager manager = engine.getActionsManager();
173
            if (manager.isEnabled(ActionsManager.ACTION_ADD_WATCH)) {
174
                manager.postAction(ActionsManager.ACTION_ADD_WATCH);
175
                return true;
176
            }
177
        }
178
        return false;
179
    }
163
}
180
}

Return to bug 180558