You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

components-extensions.asciidoc 896B

1234567891011121314151617181920212223242526272829303132333435363738
  1. ---
  2. title: Component Extensions
  3. order: 6
  4. layout: page
  5. ---
  6. [[components.extensions]]
  7. = Component Extensions
  8. Components and UIs can have extensions which are attached to the component
  9. dynamically. Especially, many add-ons are extensions.
  10. How a component is extended depends on the extension. Typically, they have an
  11. [methodname]#extend()# method that takes the component to be extended as the
  12. parameter.
  13. [source, java]
  14. ----
  15. TextField tf = new TextField("Hello");
  16. layout.addComponent(tf);
  17. // Add a simple extension
  18. new CapsLockWarning().extend(tf);
  19. // Add an extension that requires some parameters
  20. CSValidator validator = new CSValidator();
  21. validator.setRegExp("[0-9]*");
  22. validator.setErrorMessage("Must be a number");
  23. validator.extend(tf);
  24. ----
  25. Development of custom extensions is described in
  26. <<dummy/../../../framework/gwt/gwt-extension#gwt.extension,"Component and UI
  27. Extensions">>.