Examples of TreeNodeImpl


Examples of org.richfaces.model.TreeNodeImpl

    super(arg0);
  }

  protected void setUp() throws Exception {
    super.setUp();
    node = new TreeNodeImpl();
  }
View Full Code Here

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

Examples of org.richfaces.model.TreeNodeImpl

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

Examples of org.richfaces.model.TreeNodeImpl

    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

Examples of org.richfaces.model.TreeNodeImpl

    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

Examples of org.richfaces.model.TreeNodeImpl

    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

Examples of org.richfaces.model.TreeNodeImpl

      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

Examples of org.richfaces.model.TreeNodeImpl

      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

Examples of org.richfaces.model.TreeNodeImpl

       * @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

Examples of org.richfaces.model.TreeNodeImpl

       * @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
TOP
Copyright © 2018 www.massapi.com. 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.