开发者

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:

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

Something like Spy++ for SWT?

  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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜