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.

FeatureTextField.java 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* *************************************************************************
  2. IT Mill Toolkit
  3. Development of Browser User Intarfaces 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/license.txt. Use of this product might
  8. require purchasing a commercial license from IT Mill Ltd. For guidelines
  9. on usage, see license/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 FeatureTextField extends Feature {
  21. public FeatureTextField() {
  22. super();
  23. }
  24. protected Component getDemoComponent() {
  25. OrderedLayout l = new OrderedLayout();
  26. // Test component
  27. TextField tf = new TextField("Caption");
  28. Panel test = new Panel("TextField Component Demo");
  29. test.addComponent(tf);
  30. l.addComponent(test);
  31. // Properties
  32. PropertyPanel p = new PropertyPanel(tf);
  33. l.addComponent(p);
  34. Form f =
  35. p.createBeanPropertySet(
  36. new String[] {
  37. "columns",
  38. "rows",
  39. "wordwrap",
  40. "writeThrough",
  41. "readThrough",
  42. "nullRepresentation",
  43. "nullSettingAllowed",
  44. "secret" });
  45. p.addProperties("Text field properties", f);
  46. return l;
  47. }
  48. protected String getExampleSrc() {
  49. return "TextField tf = new TextField(\"Caption\");\n"
  50. + "tf.setValue(\"Contents\");";
  51. }
  52. /**
  53. * @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML()
  54. */
  55. protected String getDescriptionXHTML() {
  56. return "<p>TextField combines the logic of both the single line text-entry field and the multi-line "
  57. + "text-area into one component. "
  58. + "As with all Data-components of IT Mill Toolkit, the TextField can also be bound to an "
  59. + "underlying data source, both directly or in a buffered (asynchronous) "
  60. + "mode. In buffered mode its background color will change to indicate "
  61. + "that the value has changed but is not committed.</p>"
  62. + "<p>Furthermore a validators may be bound to the component to "
  63. + "check and validate the given input before it is actually commited."
  64. + "</p>"
  65. + "<p>On the demo tab you can try out how the different properties affect the "
  66. + "presentation of the component.</p>";
  67. }
  68. protected String getImage() {
  69. return "textfield.gif";
  70. }
  71. protected String getTitle() {
  72. return "TextField";
  73. }
  74. }