Search in sources :

Example 26 with GenericTreeNode

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

the class QuestionPoolMenuTreeModel method buildFinalSubTreeModel.

public void buildFinalSubTreeModel(TreeNode rootNode) {
    if (!securityCallback.canUseReviewProcess())
        return;
    qpoolTaxonomyTreeBuilder.loadTaxonomyLevelsFinal(identity);
    List<TaxonomyLevel> taxonomyLevels = qpoolTaxonomyTreeBuilder.getTreeTaxonomyLevels();
    if (!taxonomyLevels.isEmpty()) {
        finalNode = new GenericTreeNode(translator.translate("menu.final"));
        finalNode.setTitle(translator.translate("menu.final"));
        rootNode.addChild(finalNode);
        for (TaxonomyLevel taxonomyLevel : taxonomyLevels) {
            TreeNode node = new FinalTreeNode(stackPanel, securityCallback, taxonomyLevel);
            finalNode.addChild(node);
        }
        setFirstChildAsDelegate(finalNode);
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel)

Example 27 with GenericTreeNode

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

the class ScormAPIandDisplayController method switchToNextOrPreviousSco.

private void switchToNextOrPreviousSco(Link link) {
    String nextScoId = (String) link.getUserObject();
    GenericTreeNode tn = (GenericTreeNode) treeModel.getNodeByScormItemId(nextScoId);
    menuTree.setSelectedNodeId(tn.getIdent());
    iframectr.getInitialComponent().setVisible(true);
    String identifierRes = (String) tn.getUserObject();
    updateNextPreviousButtons(nextScoId);
    displayMessages(nextScoId, identifierRes);
    updateMenuTreeIconsAndMessages();
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode)

Example 28 with GenericTreeNode

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

the class ScormAPIandDisplayController method updateMenuTreeIconsAndMessages.

private void updateMenuTreeIconsAndMessages() {
    menuTree.setDirty(true);
    Map<String, String> itemsStat = scormAdapter.getScoItemsStatus();
    Map<String, GenericTreeNode> idToNode = treeModel.getScormIdToNodeRelation();
    for (Iterator<String> it = itemsStat.keySet().iterator(); it.hasNext(); ) {
        String itemId = it.next();
        GenericTreeNode tn = idToNode.get(itemId);
        // change icon decorator
        tn.setIconDecorator1CssClass("o_scorm_" + itemsStat.get(itemId));
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode)

Example 29 with GenericTreeNode

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

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 30 with GenericTreeNode

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

the class EPTOCTreeModel method loadChildNode.

protected void loadChildNode(PortfolioStructure structure, TreeNode structureNode) {
    structureNode.removeAllChildren();
    List<PortfolioStructure> structs = ePFMgr.loadStructureChildren(structure);
    for (PortfolioStructure portfolioStructure : structs) {
        loadNode(portfolioStructure, structureNode);
    }
    List<AbstractArtefact> artList = ePFMgr.getArtefacts(structure);
    for (AbstractArtefact artefact : artList) {
        String artefactIdent = structureNode.getIdent() + artefact.getKey().toString();
        GenericTreeNode artefactNode = new GenericTreeNode(artefactIdent, artefact.getTitle(), artefact);
        artefactNode.setIconCssClass("o_icon o_ep_artefact " + artefact.getIcon());
        structureNode.addChild(artefactNode);
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) PortfolioStructure(org.olat.portfolio.model.structel.PortfolioStructure) AbstractArtefact(org.olat.portfolio.model.artefacts.AbstractArtefact)

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