src/java/de/uapcore/lightpit/LightPITModule.java

changeset 21
b213fef2539e
parent 20
bd1a76c91d5b
child 24
8137ec335416
     1.1 --- a/src/java/de/uapcore/lightpit/LightPITModule.java	Sat Mar 31 19:35:04 2018 +0200
     1.2 +++ b/src/java/de/uapcore/lightpit/LightPITModule.java	Sun Apr 01 18:16:47 2018 +0200
     1.3 @@ -60,7 +60,7 @@
     1.4      String[] requires() default {};
     1.5      
     1.6      /**
     1.7 -     * The path for this module, which will be used for the menu entry.
     1.8 +     * The path for this module, which will also be used for the menu entry.
     1.9       * 
    1.10       * This path must adhere to the URL pattern of the Servlet but must not
    1.11       * contain any starting or trailing slashes.
    1.12 @@ -70,6 +70,21 @@
    1.13      String modulePath();
    1.14      
    1.15      /**
    1.16 +     * Returns the properties key for the module name.
    1.17 +     * 
    1.18 +     * @return the properties key
    1.19 +     */
    1.20 +    String nameKey() default "name";
    1.21 +    
    1.22 +    /**
    1.23 +     * Returns the properties key for the module description.
    1.24 +     * 
    1.25 +     * @return the properties key
    1.26 +     */
    1.27 +    String descKey() default "description";
    1.28 +    
    1.29 +    
    1.30 +    /**
    1.31       * Returns the properties key for the menu label.
    1.32       * 
    1.33       * Set this string to empty string, if the module should be hidden from
    1.34 @@ -105,22 +120,26 @@
    1.35       * are proxied by this object.
    1.36       */
    1.37      public static class ELProxy {
    1.38 -        private final String bundleBaseName, modulePath, menuKey, titleKey;
    1.39 +        private final String bundleBaseName, modulePath, menuKey, titleKey, nameKey, descKey;
    1.40          
    1.41          public static ELProxy convert(LightPITModule annotation) {
    1.42              return new ELProxy(
    1.43                      annotation.bundleBaseName(),
    1.44                      annotation.modulePath(),
    1.45                      annotation.menuKey(),
    1.46 -                    annotation.titleKey()
    1.47 +                    annotation.titleKey(),
    1.48 +                    annotation.nameKey(),
    1.49 +                    annotation.descKey()
    1.50              );
    1.51          }
    1.52  
    1.53 -        private ELProxy(String bundleBaseName, String modulePath, String menuKey, String titleKey) {
    1.54 +        private ELProxy(String bundleBaseName, String modulePath, String menuKey, String titleKey, String nameKey, String descKey) {
    1.55              this.bundleBaseName = bundleBaseName;
    1.56              this.modulePath = modulePath;
    1.57              this.menuKey = menuKey;
    1.58              this.titleKey = titleKey;
    1.59 +            this.nameKey = nameKey;
    1.60 +            this.descKey = descKey;
    1.61          }
    1.62  
    1.63          public String getBundleBaseName() {
    1.64 @@ -138,5 +157,14 @@
    1.65          public String getTitleKey() {
    1.66              return titleKey;
    1.67          }
    1.68 +
    1.69 +        public String getNameKey() {
    1.70 +            return nameKey;
    1.71 +        }
    1.72 +
    1.73 +        public String getDescKey() {
    1.74 +            return descKey;
    1.75 +        }
    1.76 +        
    1.77      }
    1.78  }

mercurial