1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.util;
17
18 import org.kuali.rice.krad.uif.field.DataField;
19
20 public class GroupKeyDataField extends DataField implements SingleGroupKeyField {
21 String singleGroupKey = null;
22 public void singleGroupKeyCheck() {
23 if (TKUtils.singleGroupKeyExists())
24 {
25 singleGroupKey = TKUtils.getSingleGroupKey();
26 }
27 }
28
29 public GroupKeyDataField() {
30 super();
31
32 singleGroupKeyCheck();
33 }
34
35 public boolean isReadOnly() {
36 if (TKUtils.singleGroupKeyExists())
37 {
38 return true;
39 }
40
41 return super.isReadOnly();
42 }
43
44 public String getForcedValue() {
45 if (TKUtils.singleGroupKeyExists())
46 {
47 return singleGroupKey;
48 }
49
50 return super.getForcedValue();
51 }
52
53 public boolean isAddHiddenWhenReadOnly() {
54 if (TKUtils.singleGroupKeyExists())
55 {
56 return true;
57 }
58
59 return super.isAddHiddenWhenReadOnly();
60 }
61
62 public String getDefaultValue() {
63 if (TKUtils.singleGroupKeyExists())
64 {
65 return singleGroupKey;
66 }
67
68 return super.getDefaultValue();
69 }
70 }