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 String getSelectedRowKeysAsString() { String value = null; Object selection = getSelection(); String selectionMode = 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); for (int i = 0; i < nodes.length; i++) { builder.append(nodes[i].getRowKey()); if (i != (nodes.length - 1)) { builder.append(","); } } value = builder.toString(); } } return value; }
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); } } } }
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); } } }
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); } }
protected void encodeMarkup(FacesContext context, Tree tree) throws IOException { boolean vertical = tree.getOrientation().equals("vertical"); TreeNode root = tree.getValue(); if (root != null && root.getRowKey() == null) { root.setRowKey(ROOT_ROW_KEY); tree.buildRowKeys(root); tree.initPreselection(); } if (vertical) { encodeVerticalTree(context, tree, root); } else { encodeHorizontalTree(context, tree, root); } }
boolean localMatch = true; boolean globalMatch = false; String rowKey = childNode.getRowKey(); tt.setRowKey(rowKey);
TreeNode root = tree.getValue(); if (root != null && root.getRowKey() == null) { root.setRowKey(ROOT_ROW_KEY); tree.buildRowKeys(root);
String rowKey = node.getRowKey(); boolean selected = node.isSelected(); boolean partialSelected = node.isPartialSelected();
protected void encodeNode(FacesContext context, TreeTable tt, TreeNode treeNode) throws IOException { ResponseWriter writer = context.getResponseWriter(); String rowKey = treeNode.getRowKey(); String parentRowKey = treeNode.getParent().getRowKey(); tt.setRowKey(rowKey); String icon = treeNode.isExpanded() ? TreeTable.COLLAPSE_ICON : TreeTable.EXPAND_ICON;
boolean isDisabled = tree.isDisabled(); if (root != null && root.getRowKey() == null) { root.setRowKey(ROOT_ROW_KEY); tree.buildRowKeys(root);
if (root.getRowKey() == null) { root.setRowKey(ROOT_ROW_KEY); tt.buildRowKeys(root);
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); } } } }
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); } } }
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); } }