use of org.primefaces.component.tree.UITreeNode in project primefaces by primefaces.
the class UITree method visitColumns.
private boolean visitColumns(VisitContext context, Lazy<TreeNode> root, VisitCallback callback, String rowKey, boolean visitNodes) {
String treeNodeType = null;
if (visitNodes) {
setRowKey(root, rowKey);
if (rowKey == null) {
return false;
}
TreeNode rowNode = getRowNode();
if (rowNode != null) {
treeNodeType = rowNode.getType();
}
}
if (getChildCount() > 0) {
for (UIComponent child : getChildren()) {
if (child instanceof Columns) {
Columns columns = (Columns) child;
for (int i = 0; i < columns.getRowCount(); i++) {
columns.setRowIndex(i);
boolean value = visitColumnContent(context, callback, columns);
if (value) {
columns.setRowIndex(-1);
return true;
}
}
columns.setRowIndex(-1);
} else if (child instanceof UIColumn) {
if (child instanceof UITreeNode) {
UITreeNode uiTreeNode = (UITreeNode) child;
if (visitNodes && treeNodeType != null && !treeNodeType.equals(uiTreeNode.getType())) {
continue;
}
}
if (child.visitTree(context, callback)) {
return true;
}
}
}
}
return false;
}
Aggregations