1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.freemarker;
17
18 import java.io.IOException;
19 import java.io.Serializable;
20 import java.util.List;
21
22 import org.kuali.rice.krad.uif.component.Component;
23 import org.kuali.rice.krad.uif.container.CollectionGroup;
24 import org.kuali.rice.krad.uif.layout.StackedLayoutManager;
25
26 import freemarker.core.Environment;
27 import freemarker.core.InlineTemplateAdaptor;
28 import freemarker.template.TemplateException;
29
30
31
32
33
34
35 public class FreeMarkerStackedAdaptor implements InlineTemplateAdaptor, Serializable {
36
37 private static final long serialVersionUID = -4442716566711789593L;
38
39
40
41
42
43
44 @Override
45 public void accept(Environment env) throws TemplateException, IOException {
46 @SuppressWarnings("unchecked")
47 List<? extends Component> items = FreeMarkerInlineRenderUtils.resolve(env, "items", List.class);
48 StackedLayoutManager manager = FreeMarkerInlineRenderUtils.resolve(env, "manager", StackedLayoutManager.class);
49 CollectionGroup container = FreeMarkerInlineRenderUtils.resolve(env, "container", CollectionGroup.class);
50 FreeMarkerInlineRenderUtils.renderStacked(env, items, manager, container);
51 }
52
53 }