Component extensions, building widgetset.

Hello,

I am trying to get the CapLockWarning example extension working in my Vaadin7 project.
The project is set up in Eclipse but I’m not using the plugin, building is done using Ant.

The tutorial/wiki says this in the end:

“An extension connector needs to be included in a widget set. The class must therefore be defined under the client package of a widget set, just like with component connectors.”

Can someone in short explain where to place the extension and connector source files, and how to add the connector to a widgetset (the default widgetset or creating a new one?) and how to compile the widgetset using Ant and Vaadin 7?

Thanks!

So what the text that you pasted is trying to say, is, that the code you have at hand (the extension) needs to be compiled from Java into JavaScript. This is how Vaadin works in the browser. First of you have to get a widget set definition. That widgetset definition tells where GWT can find all the relevant files that should be compiled into Javascript. Explanation on how widget sets works can be found
here
. What you need on top of the example in that page is a row defining a package named ‘client’ to indicate that it has more files there is more files that needs to be compiled.
So basically this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" 
"http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
	<inherits name="com.vaadin.DefaultWidgetSet" />
    <source path="client" />
</module>

Then you put that file somewhere in you src folder. Within the package where that file is, you create a new package named ‘client’. Into that package, you put your extension’s connector. Then you have to
compile your custom widget set
. Lastly, you have to
inform your web.xml
to use your newly compiled widget set. Now you are good to go.

Thanks a lot!
Everything is working fine now.