当前位置: 动力学知识库 > 问答 > 编程问答 >

java - I want to see inner values of GWT variables (JavaScriptObjects).

问题描述:

I want to see GWT framework's Class's inner property values at the time of debug via Eclipse.

Suppose I have one object of com.smartgwt.client.widgets.tab.TabSet as tabSet

Now I want to see how many tabs in this tabset via debugging this.

I mean I want to see the values of properties of this TabSet or any other Object like Record, Tab, Layout, etc.

Can anybody help me in this?

网友答案:

When running in the debugger, you can use the JsoInspector.convertToInspectableObject() method. It takes a JavaScriptObject and does its best to inspect the object in an IDE-friendly fashion. From the JavaDocs:

This class provides an API for IDEs to inspect JavaScript objects and is not intended to be used in GWT applications. IDEs that allow custom value renderers for debugging can use it to box JavaScript objects into suitable Java types.

网友答案:

Use API methods on whatever object (e.g. tabSet.getNumTabs(), tabSet.getTabs()[0].getTitle()) instead of evaluating the object itself.

Unlike in normal java debugging, you won't automatically see all fields and their values by just evaluating an object.

分享给朋友:
您可能感兴趣的文章:
随机阅读: