Package org.richfaces.model

Examples of org.richfaces.model.TreeNode


      tree.setRowKey(rowKey);
      assertFalse(tree.isRowAvailable());
  }
 
  public final void testManipulateState() {
      TreeNode rootNode = new TreeNodeImpl<String>();
      rootNode.setData("root");
      tree.setValue(rootNode);
      tree.setPreserveModel("");
     
      TreeNode<String> newNode = new TreeNodeImpl<String>();
      newNode.setData("Sample node");     
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

   * @param event
   */
  public void processSelection(NodeSelectedEvent event) {
//    log.info("StorageBackingBean processSelection()");
        HtmlTree tree = (HtmlTree) event.getComponent();
        TreeNode currentNode = tree.getTreeNode(tree.getRowKey());
    log.info("StorageBackingBean processSelection() currentNode: " + currentNode.getData() +
        ", isLeaf: " + currentNode.isLeaf());
        if (currentNode.isLeaf()){
           this.setSelTreeNode(currentNode);
       
  }
View Full Code Here

//    log.info("StorageBackingBean processDrop()");
      // resolve drag source attributes
        UITreeNode srcNode = (dropEvent.getDraggableSource() instanceof UITreeNode) ? (UITreeNode) dropEvent.getDraggableSource() : null;
        UITree srcTree = srcNode != null ? srcNode.getUITree() : null;
        TreeRowKey dragNodeKey = (dropEvent.getDragValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent.getDragValue() : null;
        TreeNode draggedNode = dragNodeKey != null ? srcTree.getTreeNode(dragNodeKey) : null;
       
        log.info("dropped key: " + dragNodeKey);
      
        //add to list of selected properties
        if(draggedNode!=null) {
        log.info("StorageBackingBean processDrop() dndSelNodes.put key: " + ((RegistryPropertyImpl) draggedNode.getData()).getHumanReadableName());
          this.dndSelNodes.put(((RegistryPropertyImpl) draggedNode.getData()).getHumanReadableName(), draggedNode);
        }
  }
View Full Code Here

  private void processAddNodeActionEvent(UITreeNode srcNode) {
//    log.info("StorageBackingBean processAddNodeActionEvent()");
      UITree srcTree = srcNode != null ? srcNode.getUITree() : null;
      TreeRowKey dragNodeKey = (srcNode.getDragValue() instanceof TreeRowKey) ? (TreeRowKey) srcNode.getDragValue() : null;
      TreeNode draggedNode = dragNodeKey != null ? srcTree.getTreeNode(dragNodeKey) : null;
     
      log.info("dropped key: " + dragNodeKey);
     
      //add to list of selected properties
      if(draggedNode!=null) {
        log.info("StorageBackingBean processAddNodeActionEvent() dndSelNodes.put key: " + ((RegistryPropertyImpl) draggedNode.getData()).getHumanReadableName());
          this.dndSelNodes.put(((RegistryPropertyImpl) draggedNode.getData()).getHumanReadableName(), draggedNode);
      }
  }
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

          if (metadataList != null) {
            ListIterator<Metadata> iterMeta = metadataList.listIterator();
       
                if (metadataList.size() > 0)
                {
                  TreeNode metadatasNode = addNode(childNode, ModelConfiguration.DigitalObjectModel.METADATA_LIST.name());
                  int index = 0;
              while(iterMeta.hasNext())
              {
                      TreeNode metadataNode = addNodeExt(metadatasNode,
                        ModelConfiguration.DigitalObjectModel.MetadataList.METADATA.name(), index);
                Metadata metadataObj = iterMeta.next();
                try
                {
                          if (metadataObj.getType() != null) {
View Full Code Here

          if (metadataList != null) {
            ListIterator<Metadata> iterMeta = metadataList.listIterator();
       
                if (metadataList.size() > 0)
                {
                  TreeNode metadatasNode = addNode(childNode,
                      ModelConfiguration.PremisModel.DESCRIPTIVE_METADATA_LIST.name());
                  int index = 0;
              while(iterMeta.hasNext())
              {
                      TreeNode metadataNode = addNodeExt(metadatasNode,
                        ModelConfiguration.PremisModel.DescriptiveMetadataList.DESCRIPTIVE_METADATA.name(), index);
                Metadata metadataObj = iterMeta.next();
                try
                {
                          if (metadataObj.getType() != null) {
View Full Code Here

       * @param o The digital object
       */
      private static void describeAgent(TreeNode eventNode, Event eventObj) {
          Agent agentObj = eventObj.getAgent();  
          if (agentObj != null) {
              TreeNode agentNode = addNode(eventNode, ModelConfiguration.DigitalObjectModel.EventsList.Event.AGENT.name());
        try
        {
                  if (agentObj.getId() != null) {
                    addNode(agentNode,
                      ModelConfiguration.DigitalObjectModel.EventsList.Event.Agent.AgentObject.ID.name(), agentObj.getId());
View Full Code Here

TOP

Related Classes of org.richfaces.model.TreeNode

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.