您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

FeatureTabSheet.java 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 FeatureTabSheet extends Feature {
  21. public FeatureTabSheet() {
  22. super();
  23. }
  24. protected Component getDemoComponent() {
  25. OrderedLayout l = new OrderedLayout();
  26. TabSheet ts = new TabSheet();
  27. ts
  28. .addTab(
  29. new Label(
  30. "This is an example Label component that is added into Tab 1."),
  31. "Tab 1 caption", null);
  32. ts
  33. .addTab(
  34. new Label(
  35. "This is an example Label component that is added into Tab 2."),
  36. "Tab 2 caption", null);
  37. ts
  38. .addTab(
  39. new Label(
  40. "This is an example Label component that is added into Tab 3."),
  41. "Tab 3 caption", null);
  42. l.addComponent(ts);
  43. // Properties
  44. propertyPanel = new PropertyPanel(ts);
  45. setJavadocURL("ui/TabSheet.html");
  46. return l;
  47. }
  48. protected String getExampleSrc() {
  49. return "TabSheet ts = new TabSheet();\n"
  50. + "ts.addTab(new Label(\"This is an example Label component that is added into Tab 1.\"),\"Tab 1 caption\",null);\n"
  51. + "ts.addTab(new Label(\"This is an example Label component that is added into Tab 2.\"),\"Tab 2 caption\",null);\n"
  52. + "ts.addTab(new Label(\"This is an example Label component that is added into Tab 3.\"),\"Tab 3 caption\",null);";
  53. }
  54. protected String getDescriptionXHTML() {
  55. return "A multicomponent container with tabs for switching between them.<br/>"
  56. + "In the normal case, one would place a layout component on each tab.<br/><br />"
  57. + "On the demo tab you can try out how the different properties affect "
  58. + "the presentation of the component.";
  59. }
  60. protected String getImage() {
  61. return "icon_demo.png";
  62. }
  63. protected String getTitle() {
  64. return "TabSheet";
  65. }
  66. }