1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.widget;
17
18 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
21 import org.kuali.rice.krad.uif.util.ExpressionUtils;
22 import org.kuali.rice.krad.uif.view.HistoryEntry;
23 import org.kuali.rice.krad.uif.view.View;
24 import org.kuali.rice.krad.uif.component.Component;
25
26 import java.util.ArrayList;
27 import java.util.HashMap;
28 import java.util.List;
29 import java.util.Map;
30
31
32
33
34
35
36
37 @BeanTag(name = "breadcrumbs", parent = "Uif-Breadcrumbs")
38 public class BreadCrumbs extends WidgetBase {
39 private static final long serialVersionUID = -2864287914665842251L;
40
41 private boolean displayHomewardPath;
42 private boolean displayPassedHistory;
43 private boolean displayBreadcrumbsWhenOne;
44
45 private List<HistoryEntry> homewardPathList;
46
47 public BreadCrumbs() {
48 homewardPathList = new ArrayList<HistoryEntry>();
49 }
50
51
52
53
54
55
56
57
58
59
60
61 @Override
62 public void performApplyModel(View view, Object model, Component parent) {
63 super.performApplyModel(view, model, parent);
64
65 if (homewardPathList != null) {
66 Map<String, Object> context = new HashMap<String, Object>();
67 context.putAll(view.getContext());
68
69 for (HistoryEntry historyEntry : homewardPathList) {
70 ExpressionUtils.populatePropertyExpressionsFromGraph(historyEntry, false);
71 KRADServiceLocatorWeb.getExpressionEvaluatorService().evaluateExpressionsOnConfigurable(view,
72 historyEntry, model, context);
73 }
74 }
75 }
76
77
78
79
80
81
82
83
84 @BeanTagAttribute(name="displayHomewardPath")
85 public boolean isDisplayHomewardPath() {
86 return this.displayHomewardPath;
87 }
88
89
90
91
92 public void setDisplayHomewardPath(boolean displayHomewardPath) {
93 this.displayHomewardPath = displayHomewardPath;
94 }
95
96
97
98
99
100
101
102
103 @BeanTagAttribute(name="displayPassedHistory")
104 public boolean isDisplayPassedHistory() {
105 return this.displayPassedHistory;
106 }
107
108
109
110
111 public void setDisplayPassedHistory(boolean displayPassedHistory) {
112 this.displayPassedHistory = displayPassedHistory;
113 }
114
115
116
117
118
119
120
121
122 @BeanTagAttribute(name="homewardPathList",type= BeanTagAttribute.AttributeType.LISTBEAN)
123 public List<HistoryEntry> getHomewardPathList() {
124 return this.homewardPathList;
125 }
126
127
128
129
130 public void setHomewardPathList(List<HistoryEntry> homewardPathList) {
131 this.homewardPathList = homewardPathList;
132 }
133
134
135
136
137
138
139
140 @BeanTagAttribute(name="displayBreadcrumbsWhenOne")
141 public boolean isDisplayBreadcrumbsWhenOne() {
142 return this.displayBreadcrumbsWhenOne;
143 }
144
145
146
147
148 public void setDisplayBreadcrumbsWhenOne(boolean displayBreadcrumbsWhenOne) {
149 this.displayBreadcrumbsWhenOne = displayBreadcrumbsWhenOne;
150 }
151
152 }