protected void encodeNodeChildren(FacesContext context, TreeTable tt, TreeNode treeNode) throws IOException { int childCount = treeNode.getChildCount(); encodeNodeChildren(context, tt, treeNode, 0, childCount); }
protected void encodeHorizontalTreeNodeChildren(FacesContext context, Tree tree, TreeNode node, String clientId, String rowKey, boolean dynamic, boolean checkbox) throws IOException { int childIndex = 0; for (Iterator<TreeNode> iterator = node.getChildren().iterator(); iterator.hasNext(); ) { String childRowKey = rowKey == null ? String.valueOf(childIndex) : rowKey + UITree.SEPARATOR + childIndex; NodeOrder no = null; if (node.getChildCount() == 1) { no = NodeOrder.NONE; } else if (childIndex == 0) { no = NodeOrder.FIRST; } else if (childIndex == (node.getChildCount() - 1)) { no = NodeOrder.LAST; } else { no = NodeOrder.MIDDLE; } encodeHorizontalTreeNode(context, tree, iterator.next(), clientId, childRowKey, no, dynamic, checkbox); childIndex++; } }
protected void encodeNodeChildren(FacesContext context, TreeTable tt, TreeNode treeNode, int first, int size) throws IOException { if (size > 0) { List<TreeNode> children = treeNode.getChildren(); int childCount = treeNode.getChildCount(); int last = (first + size); if (last > childCount) { last = childCount; } for (int i = first; i < last; i++) { encodeNode(context, tt, children.get(i)); } } }
public void populateRowKeys(TreeNode node, List<String> keys) { if (node != null) { 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); } } } }
public void encodeTreeNodeChildren(FacesContext context, Tree tree, TreeNode node, String clientId, boolean dynamic, boolean checkbox, boolean droppable) throws IOException { int childCount = node.getChildCount(); if (childCount > 0) { for (int i = 0; i < childCount; i++) { if (i == 0 && droppable) { encodeDropTarget(context, tree); } encodeTreeNode(context, tree, node.getChildren().get(i), clientId, dynamic, checkbox, droppable); } } }
private void createFilteredNodeFromRowKeys(TreeTable tt, TreeNode node, TreeNode filteredNode, List<String> filteredRowKeys) { int childCount = node.getChildCount(); for (int i = 0; i < childCount; i++) { TreeNode childNode = node.getChildren().get(i); String rowKeyOfChildNode = childNode.getRowKey(); for (String rk : filteredRowKeys) { if (rk.equals(rowKeyOfChildNode) || rk.startsWith(rowKeyOfChildNode + "_") || rowKeyOfChildNode.startsWith(rk + "_")) { TreeNode newNode = createNewNode(childNode, filteredNode); if (rk.startsWith(rowKeyOfChildNode + "_")) { newNode.setExpanded(true); } createFilteredNodeFromRowKeys(tt, childNode, newNode, filteredRowKeys); break; } } } }
private 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); } } }
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); } } }
private 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); } } } }
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); } } }
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); } } }
protected void encodeFilteredNodes(FacesContext context, Tree tree, TreeNode node, String filteredValue, Locale filterLocale) throws IOException { int childCount = node.getChildCount(); if (childCount > 0) { String var = tree.getVar(); Map<String, Object> requestMap = context.getExternalContext().getRequestMap(); ValueExpression filterByVE = tree.getValueExpression(Tree.PropertyKeys.filterBy.toString()); FilterConstraint filterConstraint = getFilterConstraint(tree); for (int i = 0; i < childCount; i++) { TreeNode childNode = node.getChildren().get(i); requestMap.put(var, childNode.getData()); if (filterConstraint.applies(filterByVE.getValue(context.getELContext()), filteredValue, filterLocale)) { tree.getFilteredRowKeys().add(childNode.getRowKey()); } encodeFilteredNodes(context, tree, childNode, filteredValue, filterLocale); } requestMap.remove(var); } }
if (dndIndex >= 0 && dndIndex < dropNode.getChildCount()) { dropNodeChildren.add(dndIndex, dragNode);
protected void findFilteredRowKeys(FacesContext context, TreeTable tt, TreeNode node, List<FilterMeta> filterMetadata, Locale filterLocale, String globalFilterValue) throws IOException { int childCount = node.getChildCount(); boolean hasGlobalFilter = globalFilterValue != null && globalFilterValue.trim().length() > 0; GlobalFilterConstraint globalFilterConstraint = (GlobalFilterConstraint) FILTER_CONSTRAINTS.get(GLOBAL_MODE);
TreeNode root = tt.getValue(); String clientId = tt.getClientId(context); boolean empty = (root == null || root.getChildCount() == 0); UIComponent emptyFacet = tt.getFacet("emptyMessage");
public void populateRowKeys(TreeNode node, List<String> keys) { if (node != null) { 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); } } } }
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); } } }
private 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); } } } }
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); } } }
protected void encodeFilteredNodes(FacesContext context, Tree tree, TreeNode node, String filteredValue, Locale filterLocale) throws IOException { int childCount = node.getChildCount(); for (int i = 0; i < childCount; i++) { TreeNode childNode = node.getChildren().get(i); FilterConstraint filterConstraint = this.getFilterConstraint(tree); if (filterConstraint.applies(childNode.getData(), filteredValue, filterLocale)) { tree.getFilteredRowKeys().add(childNode.getRowKey()); } encodeFilteredNodes(context, tree, childNode, filteredValue, filterLocale); } }