Debugging of the TreeTable-Addon

Hi,

I want try to debug the TreeTable-Addon. The problem i have is described in the following thread:
TreeTable Problem
.

So I downloaded the TreeTable-Code from SVN here:
TreeTable - Code

There are four classes in the package com.vaadin.addon.treetable describing the TreeTable: Collapsible.java, HierarchicalContainerOrderedWrapper.java, TreeTable.java and VTreeTable.java

I’ve never worked with Widgets before. So why can’t I copy those four classes in my project and use the treetable? By compiling I get the following error message:


[WARN]
Widget class com.example.test.treetable.client.ui.VTreeTable was not found. The component com.example.test.treetable.TreeTable will not be included in the widgetset.

But the Class VTreeTable exists in that Package.

Then I copied the TreetableWidgetset.gwt.xml too. It works well but only if that xml-file lies in the package com.example.test.treetable. Why can’t I put it into the default package com.example.test.widegetset ?!

My next problem is: How can I debug the Widget VTreeTable? I have put a constructor like this into the VTreeTable class:

public VTreeTable()
    {
            System.out.println("test");
            ApplicationConnection.getConsole().log("test1");
            ApplicationConnection.getConsole().error("test2");
    }

But i didn’t see any output. Nothing in the eclipse-console appeared and nothing in the firebug-console either.

After changing something on the VTreeTable Widget, do I have to compile the project every time again?

regard
Dom

The VTreeTable and similar classes (named V* in Vaadin core and at least some add-ons) are not executed as Java code but are compiled into JavaScript by the GWT compiler. For some basics on this, see
the architecture overview
and
the basics from the chapter about developing custom widgets
in the book. Read also the section on
using add-ons
and/or the
related material in Directory help
.

An application can only have one widgetset in use - you must create that widgetset (if it is not already there, e.g. created by the Eclipse plugin), and it must inherit at least DefaultWidgetSet, TreetableWidgetset (a “widgetset fragment”) and any others from add-ons with widgets you want to use.

More information about developing custom widgets can be found
in this book chapter
, including about the GWT development mode which allows you to do some debugging and changes without doing the full widgetset recompilation after every time.

Note also that e.g. the relative location of VTreeTable with respect to the widgetset .gwt.xml file matters - GWT compiler only looks at specific directories under the location of the widgetset file.