]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/SingleResultNode.java
1 package org
.argeo
.slc
.client
.ui
.model
;
4 import javax
.jcr
.RepositoryException
;
5 import javax
.jcr
.Workspace
;
7 import org
.argeo
.eclipse
.ui
.TreeParent
;
8 import org
.argeo
.slc
.SlcException
;
9 import org
.argeo
.slc
.SlcNames
;
12 * UI Tree component. Wraps a result node of a JCR {@link Workspace}. It also
13 * keeps a reference to its parent node that can either be a
14 * {@link ResultFolder}, a {@link SingleResultNode} or a {@link VirtualFolder}.
18 public class SingleResultNode
extends ResultParent
implements
19 Comparable
<SingleResultNode
> {
21 private final Node node
;
22 private boolean passed
;
24 // keeps a local reference to the node's name to avoid exception when the
27 /** Creates a new UiNode in the UI Tree */
28 public SingleResultNode(TreeParent parent
, Node node
, String name
) {
32 setPassed(refreshPassedStatus());
35 public boolean refreshPassedStatus() {
38 if (node
.hasNode(SlcNames
.SLC_AGGREGATED_STATUS
)) {
39 check
= node
.getNode(SlcNames
.SLC_AGGREGATED_STATUS
);
40 passed
= check
.getProperty(SlcNames
.SLC_SUCCESS
).getBoolean();
43 // Happens only if the UI triggers a refresh while the execution
44 // is in progress and the corresponding node is being built
46 } catch (RepositoryException re
) {
47 throw new SlcException(
48 "Unexpected error while checking result status", re
);
52 /** returns the node wrapped by the current UI object */
53 public Node
getNode() {
58 * Override normal behavior : Results have no children for this view
61 public synchronized Object
[] getChildren() {
66 public boolean hasChildren() {
70 public boolean isPassed() {
75 protected void initialize() {
76 // Do nothing this object is fully initialized at instantiation time.
79 public int compareTo(SingleResultNode o
) {
80 return super.compareTo(o
);