Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

FeatureOrderedLayout.java 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 FeatureOrderedLayout extends Feature {
  21. public FeatureOrderedLayout() {
  22. super();
  23. }
  24. protected Component getDemoComponent() {
  25. OrderedLayout l = new OrderedLayout();
  26. // Example panel
  27. Panel show = new Panel("OrderedLayout component");
  28. OrderedLayout ol = new OrderedLayout();
  29. for (int i=1;i<5; i++) ol.addComponent(new TextField("Test component "+i));
  30. show.addComponent(ol);
  31. l.addComponent(show);
  32. // Properties
  33. PropertyPanel p = new PropertyPanel(ol);
  34. Form ap = p.createBeanPropertySet(new String[] { "orientation" });
  35. ap.replaceWithSelect(
  36. "orientation",
  37. new Object[] {
  38. new Integer(OrderedLayout.ORIENTATION_HORIZONTAL),
  39. new Integer(OrderedLayout.ORIENTATION_VERTICAL)},
  40. new Object[] {
  41. "Horizontal",
  42. "Vertical"});
  43. Select themes = (Select) p.getField("style");
  44. themes
  45. .addItem("form")
  46. .getItemProperty(themes.getItemCaptionPropertyId())
  47. .setValue("form");
  48. p.addProperties("OrderedLayout Properties", ap);
  49. l.addComponent(p);
  50. return l;
  51. }
  52. protected String getExampleSrc() {
  53. return "OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_FLOW);\n"
  54. + "ol.addComponent(new TextField(\"Textfield caption\"));\n"
  55. + "ol.addComponent(new Label(\"Label\"));\n";
  56. }
  57. /**
  58. * @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML()
  59. */
  60. protected String getDescriptionXHTML() {
  61. return "This feature provides a container for laying out components either "
  62. + "vertically, horizontally or flowingly. The orientation may be changed "
  63. + "during runtime. It also defines a special style for themes to implement called \"form\""
  64. + "that is used for input forms where the components are layed-out side-by-side "
  65. + "with their captions."
  66. + "<br/><br/>"
  67. + "On the demo tab you can try out how the different properties "
  68. + "affect the presentation of the component.";
  69. }
  70. protected String getImage() {
  71. return "orderedlayout.jpg";
  72. }
  73. protected String getTitle() {
  74. return "OrderedLayout";
  75. }
  76. }