Package org.richfaces.model

Examples of org.richfaces.model.TreeNodeImpl


    assertFalse(node.getChildren().hasNext());
  }
 
  public void testChildrenCount() {
    for (int i = 0; i < TEST_CHILDREN_COUNT; i++)
      node.addChild(new Integer(i), new TreeNodeImpl());
    Iterator it = node.getChildren();
    int count = 0;
    for (; it.hasNext(); it.next())
      count++;
    assertEquals(count, TEST_CHILDREN_COUNT);
View Full Code Here


  public void testIsLeafNew() {
    assertTrue(node.isLeaf());
  }
 
  public void testIsLeaf() {
    node.addChild(NODE_ID, new TreeNodeImpl());
    assertFalse(node.isLeaf());
  }
View Full Code Here

    node.addChild(NODE_ID, new TreeNodeImpl());
    assertFalse(node.isLeaf());
  }
 
  public void testParent() {
    TreeNode child = new TreeNodeImpl();
    node.addChild(NODE_ID, child);
    assertEquals(child.getParent(), node);
  }
View Full Code Here

    node.addChild(NODE_ID, child);
    assertEquals(child.getParent(), node);
  }
 
  public void testGetChild() {
    TreeNode firstNode = new TreeNodeImpl();
    firstNode.setData("First Node");
    TreeNode secondNode = new TreeNodeImpl();
    secondNode.setData("Second Node");
    node.addChild(NODE_ID, firstNode);
    node.addChild("second", secondNode);
    node.addChild("third", new TreeNodeImpl());
    assertTrue(node.getChild("second").getData().equals("Second Node"));
  }
View Full Code Here

    assertTrue(node.getChild("second").getData().equals("Second Node"));
  }

  public void testRemove() {
    assertTrue(node.isLeaf());
    node.addChild(NODE_ID, new TreeNodeImpl());
    assertFalse(node.isLeaf());
    node.removeChild(NODE_ID);
    assertTrue(node.isLeaf());
  }
View Full Code Here

      return (TreeNode) this.selNode;
    }
   
    public void setSelTreeNode(TreeNode node){
    log.info("StorageBackingBean setSelTreeNode()");
      this.selNode = new TreeNodeImpl();
    log.info("StorageBackingBean setSelTreeNode() node.getData(): " + node.getData().toString());
      selNode.setData(node.getData());
    }
View Full Code Here

      public static TreeNode standardTraverseTree(RegistryPropertyImpl cl, TreeNode node) {
        log.info("StorageBackingBean standardTraverseTree() cl.getUri(): " + cl.getUri());
        StorageDigitalObjectReference[] dors = dr.list(cl.getUri());
        log.info("StorageBackingBean standardTraverseTree() dors.length: " + dors.length);
       
            TreeNode childClass = new TreeNodeImpl();
//      log.info("StorageBackingBean standardTraverseTree() setData for node.addChild: " + (cl.getHumanReadableName()));
            childClass.setData(new DummyRegistryProperty(cl.getHumanReadableName()));
            childClass.setParent(node);
      if (dors.length>0) {
              node.removeChild(cl.getHumanReadableName());
        node.addChild(cl.getHumanReadableName(), childClass);
      }

        for (int i = 0; i < dors.length; i++) {
//          log.info("StorageBackingBean standardTraverseTree() currentConfiguration: " + currentConfiguration +
//              ", dors[i].getLeafname(): " + dors[i].getLeafname() + ", dors[i].getUri(): " + dors[i].getUri());
          // filter if filter set
//          log.info("StorageBackingBean standardTraverseTree() selectedRegistry: " + selectedRegistry);
          boolean allowNodes = false;
        boolean containsRegisrtyName = false;
        if (StorageBackingBean.registryList != null) {
            for (int idx = 0; idx < StorageBackingBean.registryList.size(); idx++) {
                  if (dors[i].getUri().toString().contains(StorageBackingBean.registryList.get(idx))) {
                    containsRegisrtyName = true;
                  }             
            }
        }
        if (!containsRegisrtyName) {
          allowNodes = true;
        }
           
          if (selectedRegistry != null && selectedRegistry.length() > 0 &&
              (dors[i].getUri().toString().contains(selectedRegistry) || selectedRegistry.equals(ALL_REGISTRIES) ||
                  allowNodes)) {
//              log.info("StorageBackingBean standardTraverseTree() process new node creation.");
                try {
                    TreeNode child = new TreeNodeImpl();
                      RegistryPropertyImpl registryProperty = new RegistryPropertyImpl(dors[i]);
                     
//                log.info("StorageBackingBean standardTraverseTree() child.setData(registryProperty): " + registryProperty +
//                    ", rp.getUri: " + registryProperty.getURI());
                     child.setData(registryProperty);
//                     log.info("#### StorageBackingBean standardTraverseTree() childClass.addChild registryProperty.getURI(): " +
//                         registryProperty.getURI());
                     if (!dors[i].isDirectory()) {
                       childClass.addChild(registryProperty.getURI(), child);
                     }
View Full Code Here

       * @param value The value of the child
       * @return The child node
       */
      private static TreeNode addNode(TreeNode node, String parentName, String value) {
//            log.info("StorageBackingBean DoTreeView addNode() parentName: " + parentName + ", value: " + value);
        TreeNodeImpl childNode = (TreeNodeImpl) addNode(node, parentName);
            TreeNodeImpl childChildNode1 = new TreeNodeImpl();
            if (value != null) {
//              log.info("#### StorageBackingBean DoTreeView standardTraverseTree() value: " + value);
               childChildNode1.setData(value);
            } else {
              log.info("StorageBackingBean DoTreeView standardTraverseTree() 2. ");
            }
            childChildNode1.setParent(childNode);
            childNode.addChild(parentName + CHILD_NODE_ID, childChildNode1);
            return childNode;
      }
View Full Code Here

       * @param parentName The parent name
       * @return The child node
       */
      private static TreeNode addNodeExt(TreeNode node, String parentName, int index) {
//            log.info("StorageBackingBean DoTreeView addNode() parentName: " + parentName);
            TreeNodeImpl childNode = new TreeNodeImpl();
            childNode.setData(parentName);
            childNode.setParent(node);
            String idxStr = NODE_ID;
            if (index >= 0) {
              idxStr = Integer.toString(index);
            }
            node.removeChild(parentName + idxStr);
View Full Code Here

               }

               if (o != null && proceedOk) {
                   log.info("StorageBackingBean DoTreeView standardTraverseTree() o != null currentConfiguration: " + currentConfiguration);
                 if (currentConfiguration.equals(DataModelConfiguration.PLANETS)) {
                    TreeNodeImpl childNode = new TreeNodeImpl();
                    childNode.setData(ModelConfiguration.DIGITAL_OBJECT_MODEL.name());
                    childNode.setParent(node);
                    node.removeChild(NODE_ID);
                    node.addChild(NODE_ID, childNode);
 
                    if (o.getTitle() != null) {
                      addNode(childNode, ModelConfiguration.DigitalObjectModel.TITLE.name(), o.getTitle());
                    }
                    if (o.getPermanentUri() != null) {
                      addNode(childNode, ModelConfiguration.DigitalObjectModel.PLANETS_URI.name(),
                          o.getPermanentUri().toString());
                    }
                    if (o.getFormat() != null) {
                      addNode(childNode, ModelConfiguration.DigitalObjectModel.FORMAT.name(),
                          o.getFormat().toString());
                    }
                    if (o.getManifestationOf() != null) {
                      addNode(childNode, ModelConfiguration.DigitalObjectModel.MANIFESTATION_OF.name(),
                          o.getManifestationOf().toString());
                    }
                    describeMetadata(childNode, o);
                    describeEvents(childNode, o);
                 } else {
                    TreeNodeImpl childNode = new TreeNodeImpl();
                    childNode.setData(ModelConfiguration.PREMIS_MODEL.name());
                    childNode.setParent(node);
                    node.removeChild(NODE_ID);
                    node.addChild(NODE_ID, childNode);
 
                      TreeNode idNode = addNode(childNode, ModelConfiguration.PremisModel.OBJECT_IDENTIFIER.name());
                    if (o.getPermanentUri() != null) {
View Full Code Here

TOP

Related Classes of org.richfaces.model.TreeNodeImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.