View Javadoc

1   package org.kuali.student.lum.common.client.configuration;
2   
3   import org.kuali.student.common.ui.client.configurable.mvc.Configurer;
4   import org.kuali.student.common.ui.client.mvc.DataModel;
5   import org.kuali.student.common.ui.client.widgets.field.layout.element.MessageKeyInfo;
6   
7   /**
8    * Skeletal implementation of {@link Configuration}.
9    *
10   * @author Igor
11   */
12  public abstract class AbstractConfiguration implements Configuration {
13  
14      protected Configurer configurer;
15  
16      public void setConfigurer(Configurer configurer) {
17          this.configurer = configurer;
18      }
19  
20      @Override
21      public void applyRestrictions() {
22      }
23  
24      @Override
25      public boolean checkPermission(DataModel model) {
26          return false;
27      }
28  
29      @Override
30      public void removeRestrictions() {
31  
32      }
33      
34      /**
35       * Generates a message info to be used in your field descriptor to get the label for the field.
36       * Used by the field descriptor with the application context to determine the label to show based on
37       * the labelKey
38       * @param labelKey key of the message - must match a message in your messages (stored in the db)
39       * @return
40       */
41      public MessageKeyInfo generateMessageInfo(String labelKey) {
42          return this.configurer.generateMessageInfo(labelKey);
43      }
44      
45      /**
46       * Gets the string corresponding to the label key passed in from the application messages
47       * @param labelKey
48       * @return
49       */
50      public String getLabel(String labelKey) {
51          return this.configurer.getLabel(labelKey);
52      }
53  }