1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.element;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
22 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
23 import org.kuali.rice.krad.uif.component.Component;
24 import org.kuali.rice.krad.uif.element.ContentElementBase;
25 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle;
26 import org.kuali.rice.krad.uif.util.LifecycleElement;
27 import org.kuali.rice.krad.uif.util.UrlInfo;
28 import org.kuali.rice.krad.uif.view.View;
29
30 import java.util.HashMap;
31 import java.util.Map;
32
33
34
35
36
37
38 @BeanTag(name = "breadcrumbItem", parent = "Uif-BreadcrumbItem")
39 public class BreadcrumbItem extends ContentElementBase {
40 private static final long serialVersionUID = 6694853722827812544L;
41
42 private String label;
43 private UrlInfo url;
44 private Component siblingBreadcrumbComponent;
45 private boolean renderAsLink;
46
47
48
49
50
51
52
53
54
55
56 @Override
57 public void performApplyModel(Object model, LifecycleElement parent) {
58 super.performApplyModel(model, parent);
59
60 View view = ViewLifecycle.getView();
61 if (url != null) {
62 Map<String, Object> context = new HashMap<String, Object>();
63
64 Map<String, Object> viewContext = view.getContext();
65 if (viewContext != null) {
66 context.putAll(viewContext);
67 }
68
69 ViewLifecycle.getExpressionEvaluator().populatePropertyExpressionsFromGraph(url, false);
70 ViewLifecycle.getExpressionEvaluator().evaluateExpressionsOnConfigurable(view, url, context);
71 }
72 }
73
74
75
76
77
78
79 @BeanTagAttribute(name = "label")
80 public String getLabel() {
81 return label;
82 }
83
84
85
86
87
88
89
90 public void setLabel(String label) {
91 this.label = label;
92 }
93
94
95
96
97
98
99 @BeanTagAttribute(name = "url")
100 public UrlInfo getUrl() {
101 return url;
102 }
103
104
105
106
107
108
109 public void setUrl(UrlInfo urlObject) {
110 this.url = urlObject;
111 }
112
113
114
115
116
117
118
119 @BeanTagAttribute(name = "siblingBreadcrumbComponent", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
120 public Component getSiblingBreadcrumbComponent() {
121 return siblingBreadcrumbComponent;
122 }
123
124
125
126
127
128
129 public void setSiblingBreadcrumbComponent(Component siblingBreadcrumbComponent) {
130 this.siblingBreadcrumbComponent = siblingBreadcrumbComponent;
131 }
132
133
134
135
136
137
138
139 @BeanTagAttribute(name = "renderAsLink")
140 public boolean isRenderAsLink() {
141 return renderAsLink;
142 }
143
144
145
146
147
148
149 public void setRenderAsLink(boolean renderAsLink) {
150 this.renderAsLink = renderAsLink;
151 }
152 }