To be able to compile widget sets in Eclipse, you need to have the Vaadin Plugin for Eclipse installed, as instructed in Section 2.2.1, “Vaadin Plugin for Eclipse”.
An application can only have one widget set, so if you use multiple add-ons and possibly your own custom widgets, they need to be combined to a single widget set that inherits them. You can create the combining widget set manually and the Eclipse plugin simply update it when you add new add-ons. Otherwise, the Eclipse plugin automatically creates a project-specific widget set under the project root source folder.
The Eclipse plugin compiles widget sets automatically by default. They do not normally need to be recompiled after changes to server-side classes, so if the automatic recompilation get annoying, disable it from the project settings.
To compile the widget set(s) manually, click the Compile Vaadin widgets button in Eclipse toolbar or press Ctrl+6. You must recompile the widget set(s) always when you install a new version of the add-on or of the Vaadin library.
Further information on defining and compiling widget sets is given in Section 11.2.2, “Recompiling the Widget Set”, Section 11.5, “Defining a Widget Set”, and Section 11.8.4, “Compiling GWT Widget Sets”.
If you need to compile the widget set with an Ant script, you can find a script template at the URL https://vaadin.com/download/misc/build-widgetset.xml. You can copy the build script to your project and, once configured, use it by entering:
$
ant -f build-widgetset.xml
See Section 11.8.4, “Compiling GWT Widget Sets” for details on configuring the build script and the available build targets, and Section 11.5, “Defining a Widget Set” for information regarding the widget set definition file.
If you are using an IDE such as Eclipse, always remember to refresh the project to synchronize it with the filesystem after compiling the widget set outside Eclipse.
If you experience problems, do the following:
Check the .gwt.xml
widget set definition file
under the widget set folder in the project root package. For
example, if the project root package is
com.example.myproject
, the widget set
definition file would be
com.example.myproject.widgetset.MyprojectWidgetset.gwt.xml
. See
Section 11.5, “Defining a Widget Set” for details on the contents of the
widget set definition file.
Check the WEB-INF/web.xml
deployment
descriptor and see that the servlet for your application has a
widget set parameter, such as the following:
<init-param> <description>Application widgetset</description> <param-name>widgetset</param-name> <param-value>com.example.myproject.widgetset.MyprojectWidgetset</param-value> </init-param>
See the VAADIN/widgetsets
directory and check
that the widget set appears there. You can remove it and recompile
to see that compilation works properly.
Use the Net tab in Firebug to see that the widget set (and theme) is loaded properly.
Use the ?debug
parameter for the application to see if
there is any version conflict between the widget set and the
Vaadin library, or the themes. See Section 12.4.1, “Debug Mode” for
details.
Refresh and recompile the project. In Eclipse, select the project and press F5, stop the server, clean the server temporary directories, and restart it.
Check the Error Log view in Eclipse (or the IDE you use).
For more specific problems related to widget sets definition and compilation, see Section 11.8.8, “Troubleshooting”.