Search in sources :

Example 76 with TreeNode

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

the class QuestionPoolMenuTreeModel method buildReviewSubTreeModel.

public void buildReviewSubTreeModel(TreeNode rootNode) {
    if (!securityCallback.canUseReviewProcess())
        return;
    qpoolTaxonomyTreeBuilder.loadTaxonomyLevelsReview(identity);
    List<TaxonomyLevel> taxonomyLevels = qpoolTaxonomyTreeBuilder.getTreeTaxonomyLevels();
    if (!taxonomyLevels.isEmpty()) {
        reviewNode = new GenericTreeNode(translator.translate("menu.review"));
        reviewNode.setTitle(translator.translate("menu.review"));
        rootNode.addChild(reviewNode);
        for (TaxonomyLevel taxonomyLevel : taxonomyLevels) {
            TreeNode node = new ReviewTreeNode(stackPanel, securityCallback, taxonomyLevel, identity, roles);
            reviewNode.addChild(node);
        }
        setFirstChildAsDelegate(reviewNode);
    }
}
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 77 with TreeNode

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

the class QuestionPoolMenuTreeModel method buildMarkedTreeNode.

private void buildMarkedTreeNode(TreeNode parentNode) {
    TreeNode node = new MarkedQuestionsTreeNode(stackPanel, securityCallback, translator.translate("menu.database.favorit"));
    parentNode.addChild(node);
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode)

Example 78 with TreeNode

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

the class QuestionPoolMenuTreeModel method buildCollectionTreeNodes.

private void buildCollectionTreeNodes(TreeNode parentNode) {
    if (!securityCallback.canUseCollections())
        return;
    List<QuestionItemCollection> collections = qpoolService.getCollections(identity).stream().sorted(Comparator.comparing(QuestionItemCollection::getName)).collect(Collectors.toList());
    for (QuestionItemCollection coll : collections) {
        TreeNode node = new CollectionTreeNode(stackPanel, securityCallback, coll);
        parentNode.addChild(node);
    }
}
Also used : QuestionItemCollection(org.olat.modules.qpool.QuestionItemCollection) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode)

Example 79 with TreeNode

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

the class QuestionPoolMenuTreeModel method buildPoolTreeNodes.

private void buildPoolTreeNodes(TreeNode parentNode) {
    if (!securityCallback.canUsePools())
        return;
    List<Pool> pools = qpoolService.getPools(identity, roles).stream().sorted(Comparator.comparing(Pool::getName)).collect(Collectors.toList());
    for (Pool pool : pools) {
        TreeNode node = new PoolTreeNode(stackPanel, securityCallback, pool);
        parentNode.addChild(node);
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) QuestionItem2Pool(org.olat.modules.qpool.QuestionItem2Pool) Pool(org.olat.modules.qpool.Pool)

Example 80 with TreeNode

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

the class QuestionPoolMenuTreeModel method setFirstChildAsDelegate.

private void setFirstChildAsDelegate(INode node) {
    if (node.getChildCount() > 0) {
        INode childNode = node.getChildAt(0);
        if (node instanceof GenericTreeNode && childNode instanceof TreeNode) {
            GenericTreeNode parent = (GenericTreeNode) node;
            TreeNode child = (TreeNode) childNode;
            parent.setDelegate(child);
        }
    }
}
Also used : INode(org.olat.core.util.nodes.INode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode)

Aggregations

TreeNode (org.olat.core.gui.components.tree.TreeNode)296 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)146 ArrayList (java.util.ArrayList)44 CourseNode (org.olat.course.nodes.CourseNode)38 TreeEvent (org.olat.core.gui.components.tree.TreeEvent)32 ContextEntry (org.olat.core.id.context.ContextEntry)30 Controller (org.olat.core.gui.control.Controller)28 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)24 AssessmentSection (uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection)22 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)20 INode (org.olat.core.util.nodes.INode)20 TaxonomyLevel (org.olat.modules.taxonomy.TaxonomyLevel)20 AssessmentItemRef (uk.ac.ed.ph.jqtiplus.node.test.AssessmentItemRef)20 ICourse (org.olat.course.ICourse)18 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)16 OLATResourceable (org.olat.core.id.OLATResourceable)16 List (java.util.List)14 TreeModel (org.olat.core.gui.components.tree.TreeModel)14 WindowControl (org.olat.core.gui.control.WindowControl)14 AssertException (org.olat.core.logging.AssertException)14