Package org.primefaces.model

Examples of org.primefaces.model.TreeNode


        }     
       
        processFacets(context, phaseId);
        processColumnFacets(context, phaseId);
       
        TreeNode root = getValue();
        if(root != null) {
            processNode(context, phaseId, root, null);
    }

        setRowKey(null);
View Full Code Here


        return false;
    }
   
    protected boolean visitNodes(VisitContext context, VisitCallback callback) {
        TreeNode root = getValue();
        if(root != null) {
            if(visitNode(context, callback, root, null)) {
                return true;
            }
    }
View Full Code Here

            else if(eventName.equals("dragdrop")) {
                String draggedNodeKey = params.get(clientId + "_draggedNode");
                String droppedNodeKey = params.get(clientId + "_droppedNode");

                this.setRowKey(draggedNodeKey);
                TreeNode draggedNode = this.getRowNode();

                this.setRowKey(droppedNodeKey);
                TreeNode droppedNode = this.getRowNode();

                //update model
                TreeNode oldParent = draggedNode.getParent();
                oldParent.getChildren().remove(draggedNode);
                droppedNode.addChild(draggedNode);

                //fire dragdrop event
                wrapperEvent = new DragDropEvent(this, behaviorEvent.getBehavior(), draggedNodeKey, droppedNodeKey);
                wrapperEvent.setPhaseId(behaviorEvent.getPhaseId());
View Full Code Here

            else if(eventName.equals("dragdrop")) {
                String draggedNodeKey = params.get(clientId + "_draggedNode");
                String droppedNodeKey = params.get(clientId + "_droppedNode");

                this.setRowKey(draggedNodeKey);
                TreeNode draggedNode = this.getRowNode();

                this.setRowKey(droppedNodeKey);
                TreeNode droppedNode = this.getRowNode();

                //update model
                TreeNode oldParent = draggedNode.getParent();
                oldParent.getChildren().remove(draggedNode);
                droppedNode.addChild(draggedNode);

                //fire dragdrop event
                wrapperEvent = new DragDropEvent(this, behaviorEvent.getBehavior(), draggedNodeKey, droppedNodeKey);
                wrapperEvent.setPhaseId(behaviorEvent.getPhaseId());
View Full Code Here

        if(tree.isNodeExpandRequest(context)) {
            String clientId = tree.getClientId(context);
            Map<String,String> params = context.getExternalContext().getRequestParameterMap();
            String rowKey = params.get(clientId + "_expandNode");
            tree.setRowKey(rowKey);
            TreeNode node = tree.getRowNode();
            node.setExpanded(true);
           
            encodeTreeNodeChildren(context, tree, node, clientId, rowKey, tree.isDynamic(), tree.isCheckboxSelection());
            tree.setRowKey(null);
        }
        else {
View Full Code Here

  }
 
  protected void encodeMarkup(FacesContext context, Tree tree) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    String clientId = tree.getClientId(context);
        TreeNode root = (TreeNode) tree.getValue();
        boolean dynamic = tree.isDynamic();
        boolean selectable = tree.getSelectionMode() != null;
        boolean checkbox = selectable && tree.getSelectionMode().equals("checkbox");
       
        //container class
        String containerClass = Tree.CONTAINER_CLASS;
        containerClass = selectable ? containerClass + " " + Tree.SELECTABLE_CLASS : containerClass;
    containerClass = tree.getStyleClass() == null ? containerClass : containerClass + " " + tree.getStyleClass();

    writer.startElement("div", tree);
    writer.writeAttribute("id", clientId, null);
        writer.writeAttribute("class", containerClass, null);
    if(tree.getStyle() != null)
            writer.writeAttribute("style", tree.getStyle(), null);

        writer.startElement("ul", null);
        writer.writeAttribute("class", Tree.ROOT_NODES_CLASS, null);

        if(root != null) {
            root.setExpanded(true);
            encodeTreeNode(context, tree, root, clientId, null, dynamic, checkbox);
        }

    writer.endElement("ul");
View Full Code Here

        Map<String,String> params = context.getExternalContext().getRequestParameterMap();
       
        String nodeKey = params.get(clientId + "_expand");
        if(nodeKey != null) {
            tt.setRowKey(nodeKey);
            TreeNode node = tt.getRowNode();
            node.setExpanded(true);
           
            encodeNode(context, tt, node, clientId, nodeKey);
        }
        else {
            encodeMarkup(context, tt);
View Full Code Here

    writer.endElement("thead");
  }
      
    protected void encodeTbody(FacesContext context, TreeTable tt) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    TreeNode root = (TreeNode) tt.getValue();
        String clientId = tt.getClientId(context);
   
    writer.startElement("tbody", null);
    writer.writeAttribute("class", TreeTable.DATA_CLASS, null);
View Full Code Here

        if(rowKey == null) {
            FacesContext.getCurrentInstance().getExternalContext().getRequestMap().remove(getVar());
        }
        else {
            TreeNode root = getValue();
            this.rowNode = findTreeNode(root, rowKey);
           
            FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(getVar(), this.rowNode.getData());
        }
    }
View Full Code Here

    private void processNodes(FacesContext context, PhaseId phaseId) {
             
        processFacets(context, phaseId);
        processColumnFacets(context, phaseId);
       
        TreeNode root = getValue();
        if(root != null) {
            processNode(context, phaseId, root, null);
    }

        setRowKey(null);
View Full Code Here

TOP

Related Classes of org.primefaces.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.