View Javadoc
1   /**
2    * Copyright 2014 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   *
15   * Created by venkat on 10/1/14
16   */
17  package org.kuali.student.cm.uif.element;
18  
19  import org.apache.commons.lang.StringUtils;
20  import org.kuali.rice.krad.uif.element.Message;
21  import org.kuali.rice.krad.uif.util.LifecycleElement;
22  
23  import java.util.HashMap;
24  import java.util.Map;
25  
26  /**
27   *
28   * A {link#Message}
29   * @author Kuali Student Team
30   */
31  public class CMLozengeMessage extends Message {
32  
33      protected Map<String,String> dataStyleMapping = new HashMap<>();
34      protected String dataToStyle;
35  
36      public CMLozengeMessage() {
37          super();
38      }
39  
40      @Override
41      public void performFinalize(Object model, LifecycleElement parent) {
42  
43          String style = dataStyleMapping.get(dataToStyle);
44  
45          if (StringUtils.isNotBlank(style)){
46              getAdditionalCssClasses().add(style);
47          }
48  
49          super.performFinalize(model,parent);
50      }
51  
52      public Map<String, String> getDataStyleMapping() {
53          return dataStyleMapping;
54      }
55  
56      public void setDataStyleMapping(Map<String, String> dataStyleMapping) {
57          this.dataStyleMapping = dataStyleMapping;
58      }
59  
60      public String getDataToStyle() {
61          return dataToStyle;
62      }
63  
64      public void setDataToStyle(String dataToStyle) {
65          this.dataToStyle = dataToStyle;
66      }
67  
68  
69  }