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
37 @BeanTags({@BeanTag(name = "sidebarNavigation", parent = "Uif-SidebarNavigationGroup"),
38 @BeanTag(name = "menuNavigation", parent = "Uif-MenuNavigationGroup")})
39 public class SidebarNavigationGroup extends GroupBase {
40 private static final long serialVersionUID = -8388015161780120970L;
41
42 private boolean renderCollapse;
43 private String openedToggleIconClass;
44 private String closedToggleIconClass;
45 private String defaultItemIconClass;
46
47 private static final String ARROW_CSS = "arrow";
48
49
50
51
52
53
54
55 @Override
56 public void performFinalize(Object model, LifecycleElement parent) {
57 super.performFinalize(model, parent);
58
59 for (Component item : this.getItems()) {
60 if (item instanceof ToggleMenu) {
61 ((ToggleMenu) item).setRenderedInList(true);
62 ((ToggleMenu) item).setToggleCaretClass(ARROW_CSS + " " + closedToggleIconClass);
63
64 if (StringUtils.isBlank(((ToggleMenu) item).getIconClass())) {
65 ((ToggleMenu) item).setIconClass(defaultItemIconClass);
66 }
67 } else if (item instanceof Action) {
68 ((Action) item).setRenderInnerTextSpan(true);
69
70 if (StringUtils.isBlank(((Action) item).getIconClass())) {
71 ((Action) item).setIconClass(defaultItemIconClass);
72 }
73 }
74 }
75 }
76
77
78
79
80
81
82 @BeanTagAttribute
83 public boolean isRenderCollapse() {
84 return renderCollapse;
85 }
86
87
88
89
90 public void setRenderCollapse(boolean renderCollapse) {
91 this.renderCollapse = renderCollapse;
92 }
93
94
95
96
97
98
99
100 @BeanTagAttribute
101 public String getOpenedToggleIconClass() {
102 return openedToggleIconClass;
103 }
104
105
106
107
108 public void setOpenedToggleIconClass(String openedToggleIconClass) {
109 this.openedToggleIconClass = openedToggleIconClass;
110 }
111
112
113
114
115
116
117
118 @BeanTagAttribute
119 public String getClosedToggleIconClass() {
120 return closedToggleIconClass;
121 }
122
123
124
125
126 public void setClosedToggleIconClass(String closedToggleIconClass) {
127 this.closedToggleIconClass = closedToggleIconClass;
128 }
129
130
131
132
133
134
135
136 @BeanTagAttribute
137 public String getDefaultItemIconClass() {
138 return defaultItemIconClass;
139 }
140
141
142
143
144 public void setDefaultItemIconClass(String defaultItemIconClass) {
145 this.defaultItemIconClass = defaultItemIconClass;
146 }
147 }