Question

I am looking for something like Spy++ but for SWT. I know there are solutions that help you out when you want info about Eclipse's plugins, so I guess this must be somewhat possible.

In my specific case, I'd need a way to Spy on code other tha my own (like Spy++ allows you to), so I guess Eclipse's plugins aren't going to help me out here!

Thanks

Was it helpful?

Solution

You mean, something like SWT Spy?

OTHER TIPS

Getting the exact code back from UI elements is kind of tough and as far as I know there are no tools in SWT domain which can do this.The reason that you can not do that is because the end result of some code i.e UI might be generated because of some if-elseif-else conditions. For example:

if(userSelection) 
{
   createSpecialToolsComposite(composite);
}else {
   createSimpleToolBar(composite);
}

In the above snippet only one of the child control will be created. To infer the other one is hard.

But still there are tools which will allow you to place your mouse over a widget and get information about that widget, including:

  1. Layout information
  2. Bounds
  3. Siblings
  4. Parent Chain (back to the shell)

enter image description here

  1. SWT SPY
  2. Is there a SWT debugger/spy?
  3. http://eclipsesource.com/blogs/2010/01/07/i-see-you-swt-spy/

SWT Spy is the correct tool to use. However, the SWT Spy page is not updated.

From Eclipse 4.7 SWT Spy is included in Eclipse PDE. So you can get it by downloading the Eclipse for RCP and RAP.

To launch SWT Spy, press: CTRL + ALT + SHIFT + F9

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top