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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* *************************************************************************
  2. IT Mill Toolkit
  3. Development of Browser User Interfaces Made Easy
  4. Copyright (C) 2000-2006 IT Mill Ltd
  5. *************************************************************************
  6. This product is distributed under commercial license that can be found
  7. from the product package on license.pdf. Use of this product might
  8. require purchasing a commercial license from IT Mill Ltd. For guidelines
  9. on usage, see licensing-guidelines.html
  10. *************************************************************************
  11. For more information, contact:
  12. IT Mill Ltd phone: +358 2 4802 7180
  13. Ruukinkatu 2-4 fax: +358 2 4802 7181
  14. 20540, Turku email: info@itmill.com
  15. Finland company www: www.itmill.com
  16. Primary source for information and releases: www.itmill.com
  17. ********************************************************************** */
  18. package com.itmill.toolkit.demo.features;
  19. import com.itmill.toolkit.ui.*;
  20. public class FeatureButton extends Feature {
  21. public FeatureButton() {
  22. super();
  23. }
  24. protected Component getDemoComponent() {
  25. OrderedLayout l = new OrderedLayout();
  26. Button b = new Button("Caption");
  27. l.addComponent(b);
  28. // Properties
  29. propertyPanel = new PropertyPanel(b);
  30. Select themes = (Select) propertyPanel.getField("style");
  31. themes.addItem("link").getItemProperty(
  32. themes.getItemCaptionPropertyId()).setValue("link");
  33. Form ap = propertyPanel
  34. .createBeanPropertySet(new String[] { "switchMode" });
  35. propertyPanel.addProperties("Button Properties", ap);
  36. setJavadocURL("ui/Button.html");
  37. return l;
  38. }
  39. protected String getExampleSrc() {
  40. return "Button b = new Button(\"Caption\");\n";
  41. }
  42. /**
  43. * @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML()
  44. */
  45. protected String getDescriptionXHTML() {
  46. return "In IT Mill Toolkit, boolean input values are represented by buttons. "
  47. + "Buttons may function either as a push buttons or switches. (checkboxes)<br/><br/>"
  48. + "Button can be directly connected to any method of an object, which "
  49. + "is an easy way to trigger events: <code> new Button(\"Play\", myPiano \"playIt\")</code>. "
  50. + "Or in checkbox-mode they can be bound to a boolean proterties and create "
  51. + " simple selectors.<br /><br /> "
  52. + "See the demo and try out how the different properties affect "
  53. + "the presentation of the component.";
  54. }
  55. protected String getImage() {
  56. return "button.jpg";
  57. }
  58. protected String getTitle() {
  59. return "Button";
  60. }
  61. }