Search in sources :

Example 1 with INodeFilter

use of org.olat.core.util.tree.INodeFilter in project openolat by klemens.

the class SelectionTreeComponentRenderer method render.

@Override
public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderResult renderResult, String[] args) {
    SelectionTreeComponent stc = (SelectionTreeComponent) source;
    Map<String, CheckboxElement> checkboxes = stc.getSubComponents();
    TreeModel tm = stc.getTreeModel();
    TreeNode rootNode = tm.getRootNode();
    if (rootNode.getChildCount() == 1) {
        rootNode = (TreeNode) rootNode.getChildAt(0);
    }
    INodeFilter selectableFilter = stc.getSelectableFilter();
    sb.append("<div class='o_selection_tree'><ul class='o_selection_tree_l0'>");
    renderNode(rootNode, rootNode, 0, stc.hashCode(), sb, renderer, stc, checkboxes, selectableFilter, args);
    sb.append("</ul></div>");
}
Also used : TreeModel(org.olat.core.gui.components.tree.TreeModel) TreeNode(org.olat.core.gui.components.tree.TreeNode) INodeFilter(org.olat.core.util.tree.INodeFilter)

Example 2 with INodeFilter

use of org.olat.core.util.tree.INodeFilter in project OpenOLAT by OpenOLAT.

the class SelectionTreeComponentRenderer method render.

@Override
public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderResult renderResult, String[] args) {
    SelectionTreeComponent stc = (SelectionTreeComponent) source;
    Map<String, CheckboxElement> checkboxes = stc.getSubComponents();
    TreeModel tm = stc.getTreeModel();
    TreeNode rootNode = tm.getRootNode();
    if (rootNode.getChildCount() == 1) {
        rootNode = (TreeNode) rootNode.getChildAt(0);
    }
    INodeFilter selectableFilter = stc.getSelectableFilter();
    sb.append("<div class='o_selection_tree'><ul class='o_selection_tree_l0'>");
    renderNode(rootNode, rootNode, 0, stc.hashCode(), sb, renderer, stc, checkboxes, selectableFilter, args);
    sb.append("</ul></div>");
}
Also used : TreeModel(org.olat.core.gui.components.tree.TreeModel) TreeNode(org.olat.core.gui.components.tree.TreeNode) INodeFilter(org.olat.core.util.tree.INodeFilter)

Aggregations

TreeModel (org.olat.core.gui.components.tree.TreeModel)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 INodeFilter (org.olat.core.util.tree.INodeFilter)2