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.

FeatureLabel.java 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 FeatureLabel extends Feature {
  21. public FeatureLabel() {
  22. super();
  23. }
  24. protected Component getDemoComponent() {
  25. OrderedLayout l = new OrderedLayout();
  26. Label lab = new Label("Label text");
  27. l.addComponent(lab);
  28. // Properties
  29. propertyPanel = new PropertyPanel(lab);
  30. Form ap = propertyPanel.createBeanPropertySet(new String[] {
  31. "contentMode", "value" });
  32. ap.replaceWithSelect("contentMode", new Object[] {
  33. new Integer(Label.CONTENT_PREFORMATTED),
  34. new Integer(Label.CONTENT_TEXT),
  35. new Integer(Label.CONTENT_UIDL),
  36. new Integer(Label.CONTENT_XHTML),
  37. new Integer(Label.CONTENT_XML) },
  38. new Object[] { "Preformatted", "Text", "UIDL (Must be valid)",
  39. "XHTML Fragment(Must be valid)",
  40. "XML (Subtree with namespace)" });
  41. propertyPanel.addProperties("Label Properties", ap);
  42. setJavadocURL("ui/Label.html");
  43. return l;
  44. }
  45. protected String getExampleSrc() {
  46. return "Label l = new Label(\"Caption\");\n";
  47. }
  48. /**
  49. * @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML()
  50. */
  51. protected String getDescriptionXHTML() {
  52. return "Labels components are for captions and plain text. "
  53. + "By default, it is a light-weight component for presenting "
  54. + "text content in application, but it can be also used to present "
  55. + "formatted information and even XML."
  56. + "<br /><br />"
  57. + "Label can also be directly associated with data property to display "
  58. + "information from different data sources automatically. This makes it "
  59. + "trivial to present the current user in the corner of applications main window. "
  60. + "<br /><br />"
  61. + "On the demo tab you can try out how the different properties affect "
  62. + "the presentation of the component.";
  63. }
  64. protected String getImage() {
  65. return "label.jpg";
  66. }
  67. protected String getTitle() {
  68. return "Label";
  69. }
  70. }