1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.container;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
21 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
22 import org.kuali.rice.krad.uif.component.Component;
23 import org.kuali.rice.krad.uif.element.Action;
24 import org.kuali.rice.krad.uif.element.ToggleMenu;
25 import org.kuali.rice.krad.uif.util.LifecycleElement;
26
27
28
29
30
31
32
33
34
35
36 @BeanTags({@BeanTag(name = "sidebarNavigationGroup-bean", parent = "Uif-SidebarNavigationGroup"),
37 @BeanTag(name = "menuNavigationGroup-bean", parent = "Uif-MenuNavigationGroup")})
38 public class SidebarNavigationGroup extends GroupBase {
39
40 private boolean renderCollapse;
41 private String openedToggleIconClass;
42 private String closedToggleIconClass;
43 private String defaultItemIconClass;
44
45
46
47
48
49
50
51 @Override
52 public void performFinalize(Object model, LifecycleElement parent) {
53 super.performFinalize(model, parent);
54
55 for (Component item: this.getItems()){
56 if (item instanceof ToggleMenu){
57 ((ToggleMenu) item).setRenderedInList(true);
58 ((ToggleMenu) item).setToggleCaretClass("arrow " + closedToggleIconClass);
59
60 if (StringUtils.isBlank(((ToggleMenu) item).getIconClass())){
61 ((ToggleMenu) item).setIconClass(defaultItemIconClass);
62 }
63 }
64 else if (item instanceof Action) {
65 ((Action) item).setRenderInnerTextSpan(true);
66
67 if (StringUtils.isBlank(((Action) item).getIconClass())){
68 ((Action) item).setIconClass(defaultItemIconClass);
69 }
70 }
71 }
72 }
73
74
75
76
77
78
79 @BeanTagAttribute(name = "renderCollapse")
80 public boolean isRenderCollapse() {
81 return renderCollapse;
82 }
83
84
85
86
87 public void setRenderCollapse(boolean renderCollapse) {
88 this.renderCollapse = renderCollapse;
89 }
90
91
92
93
94
95
96
97 @BeanTagAttribute(name = "openedToggleIconClass")
98 public String getOpenedToggleIconClass() {
99 return openedToggleIconClass;
100 }
101
102
103
104
105 public void setOpenedToggleIconClass(String openedToggleIconClass) {
106 this.openedToggleIconClass = openedToggleIconClass;
107 }
108
109
110
111
112
113
114
115 @BeanTagAttribute(name = "closedToggleIconClass")
116 public String getClosedToggleIconClass() {
117 return closedToggleIconClass;
118 }
119
120
121
122
123 public void setClosedToggleIconClass(String closedToggleIconClass) {
124 this.closedToggleIconClass = closedToggleIconClass;
125 }
126
127
128
129
130
131
132
133 @BeanTagAttribute(name = "defaultItemIconClass")
134 public String getDefaultItemIconClass() {
135 return defaultItemIconClass;
136 }
137
138
139
140
141 public void setDefaultItemIconClass(String defaultItemIconClass) {
142 this.defaultItemIconClass = defaultItemIconClass;
143 }
144 }