Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Java debugger plugin help needed
Java debugger plugin help needed [message #665030] Tue, 12 April 2011 23:41 Go to next message
Marty  is currently offline Marty Friend
Messages: 2
Registered: April 2011
Junior Member
I would like to write a plugin for the Java Debug perspective that will graphically display certain variables for the user. For example, an Image variable would show the actual image, or a Polygon variable would draw the actual Polygon.

Currently, I can generate and run (in the debug instance) the proper code to draw a variable to an image, and retrieve that information from the debugger. Right now, I display everything in an AbstractDebugView stacked next to the VariableView (top right, by default for me). However, I don't like this because it's out of context, slow, and inefficient. It currently searches through the stack of each thread and looks for any variables it knows how to display and then displays them.

I would much rather let the user point to a variable in the editor and request that information. My initial idea was to extend the popup dialog that comes up when you hover over an in-scope variable while debugging (approach A). Another alternative would be to implement something separate that would also show up (in addition to the normal one) for certain variables (approach B).

Approach A:
I can't figure out which class is used for the popup dialog in debug mode. So my questions would be: which class is it? and once I extend that class, how do I tell Eclipse to use my extension?

Approach B:
I have identified the interfaces IJavaEditorTextHover and ITextHoverExtension2 as interfaces I will probably have to implement. However, I cannot figure out how to hook them into the debug editor.

Thanks in advance for any help you can provide.
Re: Java debugger plugin help needed [message #665229 is a reply to message #665030] Wed, 13 April 2011 19:27 Go to previous messageGo to next message
Curtis Windatt is currently offline Curtis WindattFriend
Messages: 166
Registered: July 2009
Senior Member
A great place to do this kind of work is by creating your own detail pane. See IDetailPane in org.eclipse.debug.ui. The detail pane is the area at the bottom of the variables view that displays more information about the currently selected variable. In 3.3 we added an API to contribute alternate detail panes so that you can display any control instead of the default text. The detail pane carries over to the inspect dialog as well.

Platform/JDT debug doesn't provide any custom detail panes, for variables, but you can see them in action in the breakpoints view. When creating the API we wrote a detail pane that displayed Image variables as images (I don't know where that code is now). There is an example detail pane in the jdt debug tests bundle that just displays a coloured label based on the variable's scope.

Depending on what variables your plug-in would provide detail panes for, the code could be considered for contribution into JDT. It couldn't be the default setting there, but the user would have the ability to turn on the special detail panes.
Re: Java debugger plugin help needed [message #665231 is a reply to message #665229] Wed, 13 April 2011 19:33 Go to previous message
Marty  is currently offline Marty Friend
Messages: 2
Registered: April 2011
Junior Member
Awesome. That sounds like exactly what I wanted. Thanks!
Previous Topic:View with a grid
Next Topic:"Premature end of file" during product builds
Goto Forum:
  


Current Time: Fri Apr 19 05:25:41 GMT 2024

Powered by FUDForum. Page generated in 0.08264 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top