diff options
author | Markus Koivisto <markus@vaadin.com> | 2016-01-22 14:55:18 +0200 |
---|---|---|
committer | Markus Koivisto <markus@vaadin.com> | 2016-01-22 14:55:18 +0200 |
commit | 99d6de546c74f0eed230ea8253dda6b85109d2e7 (patch) | |
tree | 10fc21c557566fe3241e6e13499df18d80f8dcb2 /documentation/clientside/clientside-module.asciidoc | |
parent | 610736d9f373d4b37fd39ff8f90aabd13eab7926 (diff) | |
download | vaadin-framework-99d6de546c74f0eed230ea8253dda6b85109d2e7.tar.gz vaadin-framework-99d6de546c74f0eed230ea8253dda6b85109d2e7.zip |
Add documentation to master branch
Change-Id: I2504bb10f1ae73ec0cbc08b7ba5a88925caa1674
Diffstat (limited to 'documentation/clientside/clientside-module.asciidoc')
-rw-r--r-- | documentation/clientside/clientside-module.asciidoc | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/documentation/clientside/clientside-module.asciidoc b/documentation/clientside/clientside-module.asciidoc new file mode 100644 index 0000000000..4656264ce1 --- /dev/null +++ b/documentation/clientside/clientside-module.asciidoc @@ -0,0 +1,98 @@ +--- +title: Client-Side Module Descriptor +order: 3 +layout: page +--- + +[[clientside.module]] += Client-Side Module Descriptor + +Client-side Vaadin modules, such as the Vaadin Client-Side Engine (widget set) +or pure client-side applications, that are to be compiled to JavaScript, are +defined in a __module descriptor__ ( [filename]#.gwt.xml#) file. + +When defining a widget set to build the Vaadin client-side engine, the only +necessary task is to inherit a base widget set. If you are developing a regular +widget set, you should normally inherit the [classname]#DefaultWidgetSet#. + + +---- + +<?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> + <!-- Inherit the default widget set --> + <inherits name="com.vaadin.DefaultWidgetSet" /> +</module> +---- + +If you are developing a pure client-side application, you should instead inherit +[classname]#com.vaadin.Vaadin#, as described in +<<dummy/../../../framework/clientsideapp/clientsideapp-overview.asciidoc#clientsideapp.overview,"Client-Side +Applications">>. In that case, the module descriptor also needs an entry-point. + +If you are using the Eclipse IDE, the New Vaadin Widget wizard will +automatically create the GWT module descriptor. See +<<dummy/../../../framework/gwt/gwt-eclipse#gwt.eclipse.widget,"Creating a +Widget">> for detailed instructions. + +[[clientside.module.stylesheet]] +== Specifying a Stylesheet + +A client-side module can include CSS stylesheets. When the module is compiled, +these stylesheets are copied to the output target. In the module descriptor, +define a [literal]#++stylesheet++# element. + +For example, if you are developing a custom widget and want to have a default +stylesheet for it, you could define it as follows: + + +---- +<stylesheet src="mywidget/styles.css"/> +---- + +The specified path is relative to the __public__ folder under the folder of the +module descriptor. + + +[[gwt.module.compilation-limiting]] +== Limiting Compilation Targets + +Compiling widget sets takes considerable time. You can reduce the compilation +time significantly by compiling the widget sets only for your browser, which is +useful during development. You can do this by setting the +[parameter]#user.agent# property in the module descriptor. + + +---- +<set-property name="user.agent" value="gecko1_8"/> +---- + +The [parameter]#value# attribute should match your browser. The browsers +supported by GWT depend on the GWT version, below is a list of browser +identifiers supported by GWT. + +.GWT User Agents +[options="header"] +|=============== +|Identifier|Name +|ie6|Internet Explorer 6 +|ie8|Internet Explorer 8 +|gecko1_8|Mozilla Firefox 1.5 and later +|safari|Apple Safari and other Webkit-based browsers including Google Chrome +|opera|Opera +|ie9|Internet Explorer 9 + +|=============== + + + + +For more information about the GWT Module XML Format, please see Google Web +Toolkit Developer Guide. + + + |