Package org.zkoss.zul

Examples of org.zkoss.zul.Tree


            if (addIn) {
                funObjList.add(form);
            }
        }

        Tree funObjTree = (Tree) getFellow("funObjTree");

        SimpleTreeModel treeModel = new SimpleTreeModel(
                prepareRootNode(funObjList));

        funObjTree.setModel(treeModel);
        funObjTree.setTreeitemRenderer(funObjTreeRenderer);
        funObjTree.addEventListener(Events.ON_SELECT, new MyTreeSelectionListener(funObjTree));


        Tree funAuthObjTree = (Tree) getFellow("funAuthObjTree");

        SimpleTreeModel funAuthTreeModel = new SimpleTreeModel(
                prepareFunAuthRootNode(funAuthObjList));

        funAuthObjTree.setModel(funAuthTreeModel);
        funAuthObjTree.setTreeitemRenderer(funAuthObjTreeRenderer);
        funAuthObjTree.addEventListener(Events.ON_SELECT, new MyTreeSelectionListener(funAuthObjTree));

    }
View Full Code Here


        SqlSession sess = IBatisFactory.getInstance().getSqlSession();
        funList = sess.selectList("Fun.getAll");
        sess = null;

        // show the function
        Tree objTree = (Tree) getFellow("objTree");

        SimpleTreeModel treeModel = new SimpleTreeModel(
                prepareRootNode(funList));

        objTree.setModel(treeModel);
        objTree.setTreeitemRenderer(objTreeRenderer);

    }
View Full Code Here

         */
    }

    //ck
    public void select() {
        Tree objTree = (Tree) getFellow("objTree");
        SimpleTreeNode node = (SimpleTreeNode) objTree.getSelectedItem().getValue();
        FunForm form = (FunForm) node.getData();

        objToView(form);
    }
View Full Code Here

        }

        logger.debug("funFormList size: " + funFormList.size() + " has saved to session");

        // show the function
        Tree funTree = (Tree) getFellow("funTree");

        SimpleTreeModel treeModel = new SimpleTreeModel(
                prepareRootNode(funFormList));

        funTree.setModel(treeModel);
        funTree.setTreeitemRenderer(this);

        try {
            onLine();
        } catch (Exception e) {
            try {
View Full Code Here

        return isOpened;
    }

    public void bootFun() {
        //
        Tree funTree = (Tree) getFellow("funTree");
        Treeitem ti = funTree.getSelectedItem();
        List childrenData = ti.getChildren();

        Treerow tr = (Treerow) childrenData.get(0);

        List rowChildrenData = tr.getChildren();
View Full Code Here

        //handleSelectionAdded(tree, prev);
    }

    @SuppressWarnings("unchecked")
    public void onEvent(Event event) throws Exception {
        Tree tree = (Tree) event.getTarget();
        Set<Treeitem> delta = new HashSet<Treeitem>(); // 暫存的集合
        Set<Treeitem> current = new HashSet<Treeitem>()// 現存的集合
        // 將畫面中選取的所有項目, 放到現存集合中
        current.addAll(tree.getSelectedItems());

        System.out.println("Start");
        System.out.println("event data is " + logItems(current));
        System.out.println("prev was " + logItems(prev));
        System.out.println("current is " + logItems(current));

        logger.debug("-----------------------------------------------");


        // 找出新增的節點
        delta.addAll(current);
        delta.removeAll(prev);
        System.out.println("Added node is " + logItems(delta));
        // 如果新增節點有下屬節點,把它加到tree的選取節點中
        handleSelectionAdded(tree, delta);
        System.out.println("Now: " + logItems(tree.getSelectedItems()));

        // 找出移除的節點
        delta.clear();
        delta.addAll(prev);
        delta.removeAll(current);
        System.out.println("Removed node is " + logItems(delta));
        // 如果移除節點有下屬節點, 也把它移除掉
        handleSelectionRemoved(tree, delta);
        System.out.println("Now: " + logItems(tree.getSelectedItems()));

        // 經過新增、移除後, 最後的結果是
        prev.clear();
        prev.addAll(tree.getSelectedItems());
        System.out.println("final is " + logItems(prev));
        System.out.println("end");
    }
View Full Code Here

    separator.setParent(gb);

    // ++++++++++++++++++++++++++++++++++++++++++++++++++++++//

    // the menuTree
    mainMenuTree = new Tree();
    // tree.setSizedByContent(true);
    // tree.setZclass("z-dottree");
    mainMenuTree.setStyle("overflow:auto; border: none;");
    mainMenuTree.setParent(gb);
View Full Code Here

    String val = address.getValue();
    return val == null ? "" : val;
  }
 
  private String getDocAddress() {
    Tree sheetTree = (Tree)content.getFellow("refSheet");
    Treeitem sheet = sheetTree.getSelectedItem();
    if (sheet == null)
      return "";
   
    String sheetName = sheet.getLabel();
    String cell = ((Textbox)content.getFellow("cellRef")).getValue();
View Full Code Here

    return cellRef != null ? cellRef.getText() : "";
  }
 

  private void initDoc() {
    final Tree tree = (Tree)content.getFellow("refSheet");
    final Textbox cellRef = (Textbox)content.getFellow("cellRef");
   
    buildDocumentTree(tree, cellRef);
    cellRef.addEventListener(Events.ON_CHANGING, new EventListener() {
     
      @Override
      public void onEvent(Event evt) throws Exception {
        displayHyperlink.setValue(tree.getSelectedItem().getLabel() + "!" + ((InputEvent)evt).getValue());
      }
    });
    cellRef.focus();
  }
View Full Code Here

            }
        });
    }

    private void setTreeRenderer(TreeComponent orderElementsTree) {
        final Tree tree = (Tree) orderElementsTree.getFellowIfAny("tree");
        tree.setTreeitemRenderer(orderElementsTree.getController().getRenderer());
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Tree

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.