X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=cms%2Forg.argeo.slc.client.ui%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fmodel%2FSingleResultNode.java;fp=cms%2Forg.argeo.slc.client.ui%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fmodel%2FSingleResultNode.java;h=0000000000000000000000000000000000000000;hb=6fc94d69efe089414ac9e63bde3efab1cbf7b7ca;hp=ff14fcfb277a6101ed08230723c839daab5a831a;hpb=b36c62642bd0db11b3133b369cc026fd4b7a1ec6;p=gpl%2Fargeo-slc.git diff --git a/cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/SingleResultNode.java b/cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/SingleResultNode.java deleted file mode 100644 index ff14fcfb2..000000000 --- a/cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/SingleResultNode.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.argeo.slc.client.ui.model; - -import javax.jcr.Node; -import javax.jcr.RepositoryException; -import javax.jcr.Workspace; - -import org.argeo.eclipse.ui.TreeParent; -import org.argeo.slc.SlcException; -import org.argeo.slc.SlcNames; - -/** - * UI Tree component. Wraps a result node of a JCR {@link Workspace}. It also - * keeps a reference to its parent node that can either be a - * {@link ResultFolder}, a {@link SingleResultNode} or a {@link VirtualFolder}. - * It has no child. - */ - -public class SingleResultNode extends ResultParent implements - Comparable { - - private final Node node; - private boolean passed; - - // keeps a local reference to the node's name to avoid exception when the - // session is lost - - /** Creates a new UiNode in the UI Tree */ - public SingleResultNode(TreeParent parent, Node node, String name) { - super(name); - setParent(parent); - this.node = node; - setPassed(refreshPassedStatus()); - } - - public boolean refreshPassedStatus() { - try { - Node check; - if (node.hasNode(SlcNames.SLC_AGGREGATED_STATUS)) { - check = node.getNode(SlcNames.SLC_AGGREGATED_STATUS); - passed = check.getProperty(SlcNames.SLC_SUCCESS).getBoolean(); - return passed; - } else - // Happens only if the UI triggers a refresh while the execution - // is in progress and the corresponding node is being built - return false; - } catch (RepositoryException re) { - throw new SlcException( - "Unexpected error while checking result status", re); - } - } - - /** returns the node wrapped by the current UI object */ - public Node getNode() { - return node; - } - - /** - * Override normal behavior : Results have no children for this view - */ - @Override - public synchronized Object[] getChildren() { - return null; - } - - @Override - public boolean hasChildren() { - return false; - } - - public boolean isPassed() { - return passed; - } - - @Override - protected void initialize() { - // Do nothing this object is fully initialized at instantiation time. - } - - public int compareTo(SingleResultNode o) { - return super.compareTo(o); - } - -}