Package org.zkoss.zul

Examples of org.zkoss.zul.DefaultTreeNode


    tree.setItemRenderer(new TreeitemRenderer() {

      public void render(Treeitem item, Object data) throws Exception {
        String label = "?";
        if (data instanceof DefaultTreeNode) {
          DefaultTreeNode node = (DefaultTreeNode) data;
          Object nodeData = node.getData();
          label = nodeData.toString();
        }
        item.setLabel(label);
      }
    });
View Full Code Here


   * Converts the given list into a list of tree nodes
   */
  private List<DefaultTreeNode> toNode(List<?> objects) {
    List<DefaultTreeNode> nodes = new ArrayList<DefaultTreeNode>();
    for (Object object : objects) {
      nodes.add(new DefaultTreeNode(object, new ArrayList<DefaultTreeNode>()));
    }
    return nodes;
  }
View Full Code Here

      }
      final ArrayList<DefaultTreeNode> nodes = new ArrayList<DefaultTreeNode>();
      Utils.visitSheets(book, new SheetVisitor(){
        @Override
        public void handle(Sheet sheet) {
          nodes.add(new DefaultTreeNode(sheet.getSheetName(), Collections.EMPTY_LIST));
        }});
     
      /**
       * TODO: use i-18n instead hardcode
       */
      DefaultTreeNode root = new DefaultTreeNode("Cell Reference", nodes);
      DefaultTreeModel model = new DefaultTreeModel(root);
      tree.setModel(model);
     
      tree.addEventListener(Events.ON_SELECT, new EventListener() {
       
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.