Package org.zkoss.zul

Examples of org.zkoss.zul.DefaultTreeNode


    }
    public static DefaultTreeModel getSingleColDefaultTreeModel(int level1, int level2, int level3, String label) {
      List list = getList(10, label);
      List list2 = new ArrayList();
      for (int i =0 ,j = list.size(); i < j; i++)
        list2.add(new DefaultTreeNode(list.get(i)));
      return new DefaultTreeModel(new DefaultTreeNode(null, list2));
    }
View Full Code Here


      for (int i = 0; i < level1; i++) {
        List subList = new ArrayList(level2);
        for (int j = 0; j < level2; j++) {
          List subSubList = new ArrayList(level3);
          for (int k = 0; k < level3; k++) {
            subSubList.add(new DefaultTreeNode(new SampleBean(label + " " + rand.nextInt(level3),
                rand.nextInt(level3), cal.getTime())));
            cal.add(Calendar.MINUTE, 1);
          }
          subList.add(new DefaultTreeNode(new SampleBean(label + " " + rand.nextInt(level2),
              rand.nextInt(level2), cal.getTime()), subSubList));
          cal.add(Calendar.HOUR_OF_DAY, 1);
        }
       
        list.add(new DefaultTreeNode(new SampleBean(label + " " + rand.nextInt(level1),
            rand.nextInt(level1), cal.getTime()), subList));
        cal.add(Calendar.DAY_OF_MONTH, 1);
      }
      return new DefaultTreeModel(new DefaultTreeNode(null, list));
    }
View Full Code Here

      for (int i = 0; i < level1; i++) {
        List subList = new ArrayList(level2);
        for (int j = 0; j < level2; j++) {
          List subSubList = new ArrayList(level3);
          for (int k = 0; k < level3; k++) {
            subSubList.add(new DefaultTreeNode(new String[]{label + " " + rand.nextInt(level3),
                rand.nextInt(level3)+"", df.format(cal.getTime())}));
            cal.add(Calendar.MINUTE, 1);
          }
          subList.add(new DefaultTreeNode(new String[]{label + " " + rand.nextInt(level2),
              rand.nextInt(level2)+"", df.format(cal.getTime())}, subSubList));
          cal.add(Calendar.HOUR_OF_DAY, 1);
        }
       
        list.add(new DefaultTreeNode(new String[]{label + " " + rand.nextInt(level1),
            rand.nextInt(level1)+"", df.format(cal.getTime())}, subList));
        cal.add(Calendar.DAY_OF_MONTH, 1);
      }
      return new DefaultTreeModel(new DefaultTreeNode(null, list));
    }
View Full Code Here

      return new DefaultTreeModel(new DefaultTreeNode(null, list));
    }
    public static void addLDefaultTreeModelBean(Treeitem item, String label) {
      if (item == null || item.getValue() == null)
        return;
      DefaultTreeNode node = (DefaultTreeNode) ((DefaultTreeNode) item.getValue()).getParent();
      node.add(new DefaultTreeNode(new SampleBean(label, getRandom().nextInt(10), new Date())));
    }
View Full Code Here

      node.add(new DefaultTreeNode(new SampleBean(label, getRandom().nextInt(10), new Date())));
    }
    public static void addDefaultTreeModelAry(Treeitem item, String label) {
      if (item == null || item.getValue() == null)
        return;
      DefaultTreeNode node = (DefaultTreeNode) ((DefaultTreeNode) item.getValue()).getParent();
      node.add(new DefaultTreeNode(new String[]{label, getRandom().nextInt(10)+"",
          df.format(new Date())}));
    }
View Full Code Here

          df.format(new Date())}));
    }
    public static void updateDefaultTreeModelBean(Treeitem item, int index, String label) {
      if (item == null || item.getValue() == null)
        return;
      DefaultTreeNode node = (DefaultTreeNode) item.getValue();
      node.setData(new SampleBean(label, getRandom().nextInt(10), new Date()));
    }
View Full Code Here

      node.setData(new SampleBean(label, getRandom().nextInt(10), new Date()));
    }
    public static void updateDefaultTreeModelAry(Treeitem item, int index,String label) {
      if (item == null || item.getValue() == null)
        return;
      DefaultTreeNode node = (DefaultTreeNode) item.getValue();
      node.setData(new String[]{label, getRandom().nextInt(10)+"", df.format(new Date())});
    }
View Full Code Here

    rootFolderMap.put(url, map);
   
    parseFolders(url, map);
   
    tree.setItemRenderer(new ExplorerTreeitemRenderer());
    tree.setModel(new DefaultTreeModel(new DefaultTreeNode("ROOT",initTreeModel(rootFolderMap, new ArrayList()))));
   
    showImages(map);
  }
View Full Code Here

     
      if (value instanceof Map) {
        Map map = (Map) value;
        if (map.size() == 0) continue;
        ArrayList al = new ArrayList();
        list.add(new DefaultTreeNode(entry, al));
        initTreeModel(map, al);
      }
    }
    return list;
  }
View Full Code Here

    persons.add(mark);
    persons.add(barack);

    List<DefaultTreeNode> nodes = toNode(persons);

    DefaultTreeNode rootNode = new DefaultTreeNode(null, nodes);
    DefaultTreeModel model = new DefaultTreeModel(rootNode);

    tree.setModel(model);
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.DefaultTreeNode

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.