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.

FeaturePanel.java 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 FeaturePanel extends Feature {
  21. public FeaturePanel() {
  22. super();
  23. }
  24. protected Component getDemoComponent() {
  25. OrderedLayout l = new OrderedLayout();
  26. // Example panel
  27. Panel show = new Panel("Panel caption");
  28. show.addComponent(new Label("Label in Panel"));
  29. l.addComponent(show);
  30. // Properties
  31. propertyPanel = new PropertyPanel(show);
  32. Form ap = propertyPanel.createBeanPropertySet(new String[] { "width",
  33. "height" });
  34. Select themes = (Select) propertyPanel.getField("style");
  35. themes.addItem("light").getItemProperty(
  36. themes.getItemCaptionPropertyId()).setValue("light");
  37. themes.addItem("strong").getItemProperty(
  38. themes.getItemCaptionPropertyId()).setValue("strong");
  39. propertyPanel.addProperties("Panel Properties", ap);
  40. return l;
  41. }
  42. protected String getExampleSrc() {
  43. return "Panel show = new Panel(\"Panel caption\");\n"
  44. + "show.addComponent(new Label(\"Label in Panel\"));";
  45. }
  46. protected String getDescriptionXHTML() {
  47. return "The Panel is a container for other components, it usually draws a frame around it's "
  48. + "extremities and may have a caption to clarify the nature of the contained components purpose."
  49. + "A panel always contains firstly a layout onto which the actual contained components are added, "
  50. + "this layout may be switched on the fly. <br/><br/>"
  51. + "On the demo tab you can try out how the different properties "
  52. + "affect the presentation of the component.";
  53. }
  54. protected String getImage() {
  55. return "panel.jpg";
  56. }
  57. protected String getTitle() {
  58. return "Panel";
  59. }
  60. }