ComponentInfo.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* Copyright (c) 2001 - 2013 OpenPlans - www.openplans.org. All rights reserved.
  2. * This code is licensed under the GPL 2.0 license, available at the root
  3. * application directory.
  4. */
  5. package org.geoserver.web;
  6. import java.io.Serializable;
  7. import org.apache.wicket.Component;
  8. /**
  9. * Information about a component being plugged into a user interface.
  10. * <p>
  11. * Subclasses of this class are used to implement user interface "extension points".
  12. * For an example see {@link MainPageInfo}.
  13. * </p>
  14. *
  15. * @author Andrea Aime, The Open Planning Project
  16. * @author Justin Deoliveira, The Open Planning Project
  17. *
  18. * @param <C>
  19. */
  20. @SuppressWarnings("serial")
  21. public abstract class ComponentInfo<C extends Component> implements Serializable {
  22. /**
  23. * the id of the component
  24. */
  25. String id;
  26. /**
  27. * the title of the component
  28. */
  29. String title;
  30. /**
  31. * The description of the component
  32. */
  33. String description;
  34. /**
  35. * the class of the component
  36. */
  37. Class<C> componentClass;
  38. /**
  39. * The id of the component.
  40. */
  41. public String getId() {
  42. return id;
  43. }
  44. /**
  45. * Sets the id of the component.
  46. */
  47. public void setId(String id) {
  48. this.id = id;
  49. }
  50. /**
  51. * The i18n key for the title of the component.
  52. * <p>
  53. * The exact way this title is used depends one the component. For instance
  54. * if the component is a page, the title could be the used for a link to the
  55. * page. If the component is a panel in a tabbed panel, the title might be
  56. * the label on the tab.
  57. * </p>
  58. */
  59. public String getTitleKey() {
  60. return title;
  61. }
  62. /**
  63. * The i18n key for the title of the component.
  64. */
  65. public void setTitleKey(String title) {
  66. this.title = title;
  67. }
  68. /**
  69. * The i18n key for the description of the component.
  70. * <p>
  71. * This description is often used as a tooltip, or some contextual help.
  72. * </p>
  73. *
  74. */
  75. public String getDescriptionKey() {
  76. return description;
  77. }
  78. /**
  79. * Sets the description of the component.
  80. */
  81. public void setDescriptionKey( String description ) {
  82. this.description = description;
  83. }
  84. /**
  85. * The implementation class of the component.
  86. */
  87. public Class<C> getComponentClass() {
  88. return componentClass;
  89. }
  90. /**
  91. * Sets the implementation class of the component.
  92. */
  93. public void setComponentClass(Class<C> componentClass) {
  94. this.componentClass = componentClass;
  95. }
  96. }