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/components/components-extensions.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/components/components-extensions.asciidoc')
-rw-r--r-- | documentation/components/components-extensions.asciidoc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/documentation/components/components-extensions.asciidoc b/documentation/components/components-extensions.asciidoc new file mode 100644 index 0000000000..a84ad92f6e --- /dev/null +++ b/documentation/components/components-extensions.asciidoc @@ -0,0 +1,38 @@ +--- +title: Component Extensions +order: 6 +layout: page +--- + +[[components.extensions]] += Component Extensions + +Components and UIs can have extensions which are attached to the component +dynamically. Especially, many add-ons are extensions. + +How a component is extended depends on the extension. Typically, they have an +[methodname]#extend()# method that takes the component to be extended as the +parameter. + + +[source, java] +---- +TextField tf = new TextField("Hello"); +layout.addComponent(tf); + +// Add a simple extension +new CapsLockWarning().extend(tf); + +// Add an extension that requires some parameters +CSValidator validator = new CSValidator(); +validator.setRegExp("[0-9]*"); +validator.setErrorMessage("Must be a number"); +validator.extend(tf); +---- + +Development of custom extensions is described in +<<dummy/../../../framework/gwt/gwt-extension#gwt.extension,"Component and UI +Extensions">>. + + + |