Geertjan's Blog

  • November 25, 2014

Extending the NetBeans IDE Debugger (Part 2)

Geertjan Wielenga
Product Manager

One way to extend the NetBeans IDE Debugger is to listen to the global context Lookup, as done in part 1 and in the recent Breakpoint Beep story. Another way is to use the extension points that you see when you extend the layer file in a NetBeans module:

For the functionality shown yesterday, i.e., barking breakpoints in the NetBeans IDE Debugger, I started by adding the following to the layer file:

<folder name="Debugger">
<folder name="BreakpointsView">
<folder name="Toolbar">
<file name="org-netbeans-jpda-beep-BreakpointBeepButton-createNewBreakpointActionButton.instance">
<attr name="serviceClass" stringvalue="java.awt.Component"/>
<attr name="instanceOf" stringvalue="java.awt.Component"/>
<attr intvalue="300" name="position"/>

Then I added the following, i.e., notice that the FQN of the class below (and the 'public static' are VERY important) is matched in the XML above, and then pops up a JPanel, named BeepChoicePanel. There, the DebuggerManager is used, but that's a topic for another blog entry.

Now you know how to add new JButtons to the left sidebar of the Breakpoints window in NetBeans IDE. Probably the layer file entries could be converted to a @ServiceProvider annotation, but that's also a topic for another blog entry.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha