Package org.primefaces.model

Examples of org.primefaces.model.TreeNode


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


       
    public void buildRowKeys(TreeNode node) {
        int childCount = node.getChildCount();
        if(childCount > 0) {
            for(int i = 0; i < childCount; i++) {
                TreeNode childNode = node.getChildren().get(i);
                if(childNode.isSelected()) {
                    addToPreselection(childNode);
                }
               
                String childRowKey = (node.getParent() == null) ? String.valueOf(i) : node.getRowKey() + "_" + i;
                childNode.setRowKey(childRowKey);
                buildRowKeys(childNode);
            }
        }
    }
View Full Code Here

   
    public void populateRowKeys(TreeNode node, List<String> keys) {
        int childCount = node.getChildCount();
        if(childCount > 0) {
            for(int i = 0; i < childCount; i++) {
                TreeNode childNode = node.getChildren().get(i);
                keys.add(childNode.getRowKey());
                populateRowKeys(childNode, keys);
            }
        }
    }
View Full Code Here

   
    public void updateRowKeys(TreeNode node) {
        int childCount = node.getChildCount();
        if(childCount > 0) {
            for(int i = 0; i < childCount; i++) {
                TreeNode childNode = node.getChildren().get(i);

                String childRowKey = (node.getParent() == null) ? String.valueOf(i) : node.getRowKey() + "_" + i;
                childNode.setRowKey(childRowKey);
                updateRowKeys(childNode);
            }
        }
    }
View Full Code Here

   
    private void updateSelectedNodes(TreeNode node) {
        int childCount = node.getChildCount();
        if(childCount > 0) {
            for(int i = 0; i < childCount; i++) {
                TreeNode childNode = node.getChildren().get(i);
                if(childNode.isSelected()) {
                    addToPreselection(childNode);
                }

                updateSelectedNodes(childNode);
            }
View Full Code Here

            }
        }
    }
   
    public void refreshSelectedNodeKeys() {
        TreeNode root = this.getValue();
        this.preselection = null;
        updateSelectedNodes(root);
        initPreselection();
    }
View Full Code Here

        Object selection = this.getSelection();
        String selectionMode = this.getSelectionMode();
       
        if(selection != null) {
            if(selectionMode.equals("single")) {
                TreeNode node = (TreeNode) selection;
                value = node.getRowKey();
            }
            else {
                TreeNode[] nodes = (TreeNode[]) selection;
                StringBuilder builder = SharedStringBuilder.get(SB_GET_SELECTED_ROW_KEYS_AS_STRING);
               
View Full Code Here

        }     
       
        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

        }

        if(tt.isCheckboxSelection() && tt.isSelectionRequest(context)) {
            String selectedNodeRowKey = params.get(clientId + "_instantSelection");
            tt.setRowKey(selectedNodeRowKey);
            TreeNode selectedNode = tt.getRowNode();
            List<String> descendantRowKeys = new ArrayList<String>();
            tt.populateRowKeys(selectedNode, descendantRowKeys);
            int size = descendantRowKeys.size();
            StringBuilder sb = SharedStringBuilder.get(context, SB_DECODE_SELECTION);
           
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.