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.

Bug 218933 - Patch for: Debugger: Add action and shortcut - "enable/disable line breakpoint"
Summary: Patch for: Debugger: Add action and shortcut - "enable/disable line breakpoint"
Status: RESOLVED WORKSFORME
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: PATCH_AVAILABLE
: 156152 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-25 05:13 UTC by markiewb
Modified: 2016-06-04 11:31 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
patch for api.debugger (682 bytes, patch)
2012-10-11 02:24 UTC, markiewb
Details | Diff
patch for debugger.jpda.ui (19.54 KB, patch)
2012-10-11 02:27 UTC, markiewb
Details | Diff
patch for spi.debugger.ui (2.99 KB, patch)
2012-10-11 02:27 UTC, markiewb
Details | Diff
Screenshot showing the action in the menu/contextmenu (55.54 KB, image/png)
2012-10-11 02:35 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2012-09-25 05:13:14 UTC
[ BUILD # : 201209110001 ]
[ JDK VERSION : 1.6.35 ]

Currently there is no keyboard shortcut to disable an existing breakpoint 
because there is no action/menu item available for it (where a shortcut could 
be attached to). 

I know there is an action to add/remove a breakpoint named "toggle 
breakpoint", but that is not exactly what i want.
Comment 1 markiewb 2012-10-11 02:24:23 UTC
Created attachment 125732 [details]
patch for api.debugger
Comment 2 markiewb 2012-10-11 02:27:20 UTC
Created attachment 125733 [details]
patch for debugger.jpda.ui
Comment 3 markiewb 2012-10-11 02:27:52 UTC
Created attachment 125734 [details]
patch for spi.debugger.ui
Comment 4 markiewb 2012-10-11 02:35:50 UTC
Created attachment 125735 [details]
Screenshot showing the action in the menu/contextmenu

I want to contribute a patch for the requested feature.

I had to change
* api.debugger
* spi.debugger.ui
* debugger.jpda.ui

The patch adds a new action, which toggles the enabled state of a {@link LineBreakpoint}.
If the breakpoint is enabled, then it will be disabled.
If the breakpoint is disabled, then it will be enabled.
If the breakpoint does not exist, then it be created.

Result - see screenshot

The implementation was easy. The main code is based on {@link ToggleBreakpointActionProvider}, the rest is only registering stuff.

@NetBeans-Dev: Please review, discuss and commit the patch.
Comment 5 Jiri Kovalsky 2012-10-11 12:49:34 UTC
Is it really necessary to add yet another action to the menu? I think it's too long already now. Can't the shortcut be bound with the "Breakpoint > Enabled" popup menu action in Editor gutter?
Comment 6 markiewb 2012-10-11 14:00:04 UTC
(In reply to comment #5)
> Can't the shortcut be bound with the "Breakpoint > Enabled"
> popup menu action in Editor gutter?

Yes, why not.

Alternative 1:
Register a shortcut for the org.netbeans.modules.debugger.ui.actions.BreakpointEnableAction. But the shortcut/action did not work. I think because it is not a standard action, but a ContextAwareAction. Help from the component owner is appreciated.

Alternative 2:
Add the action from the patch, but remove the menu registration. This way the action is still available for assigning a shortcut.
Comment 7 Jiri Kovalsky 2012-10-12 08:43:05 UTC
Martine, what are your thoughts on this?

BTW, in the latter case I am afraid that discover-ability would suffer.
Comment 8 markiewb 2012-10-16 16:26:53 UTC
*** Bug 156152 has been marked as a duplicate of this bug. ***
Comment 9 markiewb 2013-05-01 19:37:09 UTC
@Martin: Any change to get the patch(es) integrated into 7.4?
Comment 10 markiewb 2013-06-05 22:53:57 UTC
(In reply to comment #9)
> @Martin: Any change to get the patch(es) integrated into 7.4?

Bump.
@Martin: Any chance to get the patch(es) integrated into 7.4?
Comment 11 markiewb 2013-08-12 20:16:31 UTC
You could also ALT-Mouseclick on the annotation icon in the left editor gutter to enable/disable the breakpoint. (Read about this approach used in IDEA)
Comment 12 markiewb 2013-09-12 20:07:07 UTC
(In reply to markiewb from comment #11)
> You could also ALT-Mouseclick on the annotation icon in the left editor
> gutter to enable/disable the breakpoint. (Read about this approach used in
> IDEA)

Related to https://netbeans.org/bugzilla/show_bug.cgi?id=169116
Comment 13 markiewb 2016-06-04 11:31:49 UTC
Resolving as worksforme. 

I provided a plugin for this issue myself. http://plugins.netbeans.org/plugin/67859/?show=true