Search in sources :

Example 41 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class EPTOCTreeModel method loadNode.

private GenericTreeNode loadNode(PortfolioStructure structure, TreeNode parentNode) {
    String ident = structure.getKey().toString();
    GenericTreeNode structureNode = new GenericTreeNode(ident, structure.getTitle(), structure);
    structureNode.setIconCssClass(structure.getIcon());
    parentNode.addChild(structureNode);
    loadChildNode(structure, structureNode);
    return structureNode;
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode)

Example 42 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class MapsTreeModel method loadStructure.

private void loadStructure(PortfolioStructure struct, GenericTreeNode parentNode) {
    String ident = struct.getKey().toString();
    GenericTreeNode structureNode = new GenericTreeNode(ident, struct.getTitle(), struct);
    structureNode.setIconCssClass(struct.getIcon());
    parentNode.addChild(structureNode);
    List<PortfolioStructure> structs = ePFMgr.loadStructureChildren(struct);
    for (PortfolioStructure childStruct : structs) {
        loadStructure(childStruct, structureNode);
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) PortfolioStructure(org.olat.portfolio.model.structel.PortfolioStructure)

Example 43 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class GenericActionExtension method createMenuNode.

/**
 * @see org.olat.core.extensions.action.ActionExtension#createMenuNode(org.olat.core.gui.UserRequest)
 */
public GenericTreeNode createMenuNode(UserRequest ureq) {
    GenericTreeNode node = new GenericTreeNode();
    node.setAltText(getDescription(ureq.getLocale()));
    node.setTitle(getActionText(ureq.getLocale()));
    node.setIconCssClass(getIconCssClass());
    node.setCssClass(getCssClass());
    node.setUserObject(this);
    return node;
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode)

Example 44 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class CourseInternalLinkTreeModel method convertToTreeNode.

/**
 * Internal helper to convert the given course node into a tree node. The
 * course node identifyer will be transfered onto the tree nodes identifyer
 *
 * @param courseNode
 * @return the course node as converted tree node
 */
private TreeNode convertToTreeNode(CourseNode courseNode) {
    // create convert this course node to a tree node
    GenericTreeNode treeNode = new GenericTreeNode();
    treeNode.setIdent(courseNode.getIdent());
    treeNode.setTitle(courseNode.getShortTitle());
    treeNode.setIconCssClass(CourseNodeFactory.getInstance().getCourseNodeConfigurationEvenForDisabledBB(courseNode.getType()).getIconCSSClass());
    // go through all children and add them as converted tree nodes
    for (int i = 0; i < courseNode.getChildCount(); i++) {
        CourseNode child = (CourseNode) courseNode.getChildAt(i);
        treeNode.addChild(convertToTreeNode(child));
    }
    return treeNode;
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) CourseNode(org.olat.course.nodes.CourseNode)

Example 45 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class PublishTreeModel method buildNode.

private GenericTreeNode buildNode(CourseEditorTreeNode cetn, boolean parentIsNew, boolean parentIsDeleted, boolean parentIsMoved) {
    GenericTreeNode gtn = new GenericTreeNode();
    gtn.setIdent(cetn.getIdent());
    gtn.setTitle(cetn.getTitle());
    gtn.setAltText(cetn.getAltText());
    gtn.setIconCssClass("o_icon " + cetn.getIconCssClass());
    if (parentIsNew || parentIsDeleted || parentIsMoved)
        gtn.setAccessible(false);
    else {
        gtn.setAccessible(cetn.hasPublishableChanges());
    }
    gtn.setCssClass(cetn.getCssClass());
    int childcnt = cetn.getChildCount();
    if (childcnt > 0) {
        for (int i = 0; i < childcnt; i++) {
            parentIsNew = parentIsNew || cetn.isNewnode();
            parentIsDeleted = parentIsDeleted || cetn.isDeleted();
            parentIsMoved = parentIsMoved || isMoved(cetn);
            GenericTreeNode childNode = buildNode((CourseEditorTreeNode) cetn.getChildAt(i), parentIsNew, parentIsDeleted, parentIsMoved);
            // if this is the first new node, enable it
            if (!parentIsNew && cetn.isNewnode())
                childNode.setAccessible(true);
            // if this is the first deleted node, enable it
            if (!parentIsDeleted && cetn.isDeleted())
                childNode.setAccessible(true);
            // if this is the first moved node, enable it
            if (!parentIsMoved && isMoved(cetn))
                childNode.setAccessible(true);
            gtn.insert(childNode, i);
        }
    }
    return gtn;
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode)

Aggregations

GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)124 TreeNode (org.olat.core.gui.components.tree.TreeNode)30 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)24 CourseNode (org.olat.course.nodes.CourseNode)10 TaxonomyLevel (org.olat.modules.taxonomy.TaxonomyLevel)10 AssessmentSection (uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection)10 HashMap (java.util.HashMap)8 INode (org.olat.core.util.nodes.INode)8 ArrayList (java.util.ArrayList)6 Element (org.dom4j.Element)6 XPath (org.dom4j.XPath)6 ExtManager (org.olat.core.extensions.ExtManager)6 Extension (org.olat.core.extensions.Extension)6 CatalogEntry (org.olat.repository.CatalogEntry)6 ActionExtension (org.olat.core.extensions.action.ActionExtension)4 GenericActionExtension (org.olat.core.extensions.action.GenericActionExtension)4 CourseNodeConfiguration (org.olat.course.nodes.CourseNodeConfiguration)4 QTI21QuestionType (org.olat.ims.qti21.model.QTI21QuestionType)4 Taxonomy (org.olat.modules.taxonomy.Taxonomy)4 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)4