]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/VirtualFolder.java
Add doAs in RCP CmsView.
[gpl/argeo-slc.git] / org.argeo.slc.client.ui / src / org / argeo / slc / client / ui / model / VirtualFolder.java
1 package org.argeo.slc.client.ui.model;
2
3 import java.util.List;
4
5 import javax.jcr.Node;
6 import javax.jcr.RepositoryException;
7
8 import org.argeo.slc.SlcException;
9 import org.argeo.slc.SlcNames;
10 import org.argeo.slc.SlcTypes;
11
12 /**
13 * UI Tree component. Virtual folder to list a list of results. Keeps a
14 * reference to its parent that might be null. It also keeps a reference to all
15 * nodes that must be displayed as children of the current virtual folder.
16 */
17 public class VirtualFolder extends ResultParent {
18 List<Node> displayedNodes;
19
20 public VirtualFolder(VirtualFolder parent, List<Node> displayedNodes,
21 String name) {
22 super(name);
23 setParent(parent);
24 this.displayedNodes = displayedNodes;
25 }
26
27 @Override
28 protected void initialize() {
29 try {
30 for (Node currNode : displayedNodes) {
31 if (currNode.isNodeType(SlcTypes.SLC_TEST_RESULT)) {
32 SingleResultNode srn = new SingleResultNode(this, currNode,
33 currNode.getProperty(SlcNames.SLC_TEST_CASE)
34 .getString());
35 addChild(srn);
36 }
37 }
38 } catch (RepositoryException re) {
39 throw new SlcException(
40 "Unexpected error while initializing ParentNodeFolder : "
41 + getName(), re);
42 }
43 }
44 }