Is there a SWT debugger/spy?

2020-02-12 05:41发布

问题:

I'm trying to debug my SWT dialog (in an Eclipse plugin.) I'd like to find out why the layout is the way it is, and where the borders are between the controls. I've seen the SWT Spy plugin (http://www.eclipse.org/swt/tools.php), but I'd like something more graphical.

I'm basically looking for something similar to the way the WebKit developer tools panel allows you to point at something and have it be outlined in both the actual rendered page, and in the HTML source.

回答1:

Check out Picasso: http://wiki.eclipse.org/PDE/Incubator/Picasso



回答2:

For Eclipse Plug-In or RCP development there is another useful tool called SWT Spy, which has the advantage that it can be turned on and off at runtime. Also there is a working update site. I couldn't find a binary version of picasso. I have to admit though, that picasso is probably better to get a quick overview.



回答3:

Yes, there is an SWT Spy. Starting from Eclipse 4.7 it is integrated in PDE. To see the SWT Spy, press CTRL + ALT + SHIFT + F9

Please see the attached image to see how it looks like:

In case of doubt, please see also: http://www.vogella.com/tutorials/EclipseCodeAccess/article.html#swt-spy