What is @Widgetset ?

I use Netbeans. Created a new Vaadin Web App project and I see this @Widgetset decorator:



public class MyUI extends UI { …

What is @Widgetset and what is “MyAppWidgetset” ?

The Vaadin components displayed and the engine communicating with the server on the web browser are implemented with Google Web Toolkit (GWT). The Vaadin browser engine is basically Java code compiled into a huge javascript lump called a Widgetset.

The annotation tells Vaadin UI what widgetset to use - in this case a custom widgetset called MyAppWidgetset. The widgetset needs to be compiled at least once and everytime you update Vaadin version or you add a Vaadin add-on from Vaadin Directory. If you remove the annotation, a default widgetset is used from vaadin-client-compiled.jar.

Can I rename “MyAppWidgetset” to anything I want?

Yes you can. You need to rename the particular .gwt.xml file and change the annotation. Then you need to recompile the widget set. mvn clean install if you use maven.


Would (or should) I create a new value for Widgetset for each of my UI’s? If I understand what you’re saying, then I understand that if I have 4 UI’s each with a @Widgetset name of “MyAppWidgetset” then all 4 UI’s will be compiled into a large Javascript with that name. But if I have multiple UI’s that only some users (of one group) will access and users of another group will access then I don’t want that jumbo JS being downloaded by everyone, but instead only for the appropate group.

Am I understanding correctly, or is it really not an issue or concern?

Most of the time you need only one UI class. If you need multiple UI classes, each UI can use the same Widgetset