Something like Spy++ for SWT?
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 m开发者_Go百科ust 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
You mean, something like SWT Spy?
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:
- Layout information
- Bounds
- Siblings
- Parent Chain (back to the shell)
- SWT SPY
- Is there a SWT debugger/spy?
- 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
精彩评论