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;
}
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);
}
}
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;
}
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;
}
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;
}
Aggregations