View Javadoc

1   package org.kuali.student.lum.common.client.lo;
2   
3   import org.kuali.student.core.assembly.data.Data;
4   import org.kuali.student.core.assembly.helper.PropertyEnum;
5   
6   public class RichTextHelper {
7       private Data data;
8   
9       public enum Properties implements PropertyEnum {
10          PLAIN("plain"),
11          FORMATTED("formatted");
12          private final String key;
13  
14          private Properties(final String key) {
15              this.key = key;
16          }
17  
18          @Override
19          public String getKey() {
20              return this.key;
21          }
22      }
23  
24      public RichTextHelper() {
25          data = new Data();
26      }
27  
28      public RichTextHelper(Data data) {
29          this.data = data;
30      }
31  
32      public Data getData() {
33          return data;
34      }
35  
36      public void setData(Data data) {
37          this.data = data;
38      }
39  
40      public void setPlain(String plain) {
41          data.set(Properties.PLAIN.getKey(), plain);
42      }
43  
44      public String getPlain() {
45          return (String) data.get(Properties.PLAIN.getKey());
46      }
47  
48      public void setFormatted(String formatted) {
49          data.set(Properties.FORMATTED.getKey(), formatted);
50      }
51  
52      public String getFormatted() {
53          return (String) data.get(Properties.FORMATTED.getKey());
54      }
55  }