use of org.olat.portfolio.ui.structel.EPArtefactClicked in project openolat by klemens.
the class EPTOCController method doSelectTreeElement.
private void doSelectTreeElement(UserRequest ureq, TreeEvent te) {
TreeNode selectedNode = treeCtr.getTreeModel().getNodeById(te.getNodeId());
Object userObj = selectedNode.getUserObject();
if (userObj instanceof PortfolioStructure) {
// structure clicked
structureClicked = (PortfolioStructure) userObj;
refreshAddElements(ureq, structureClicked);
delButton.setVisible(true);
// send event to load this page
fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.SELECTED, structureClicked));
} else if (userObj instanceof AbstractArtefact) {
// artefact clicked
Object parentObj = ((TreeNode) selectedNode.getParent()).getUserObject();
if (parentObj instanceof PortfolioStructure) {
artefactClicked = (AbstractArtefact) userObj;
PortfolioStructure structure = (PortfolioStructure) parentObj;
refreshAddElements(ureq, null);
delButton.setVisible(true);
fireEvent(ureq, new EPArtefactClicked(ARTEFACT_NODE_CLICKED, structure));
}
} else {
// root tree node clicked, no add/delete link
delButton.setVisible(false);
refreshAddElements(ureq, null);
fireEvent(ureq, new Event(ARTEFACT_NODE_CLICKED));
}
}
use of org.olat.portfolio.ui.structel.EPArtefactClicked in project OpenOLAT by OpenOLAT.
the class EPTOCController method doSelectTreeElement.
private void doSelectTreeElement(UserRequest ureq, TreeEvent te) {
TreeNode selectedNode = treeCtr.getTreeModel().getNodeById(te.getNodeId());
Object userObj = selectedNode.getUserObject();
if (userObj instanceof PortfolioStructure) {
// structure clicked
structureClicked = (PortfolioStructure) userObj;
refreshAddElements(ureq, structureClicked);
delButton.setVisible(true);
// send event to load this page
fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.SELECTED, structureClicked));
} else if (userObj instanceof AbstractArtefact) {
// artefact clicked
Object parentObj = ((TreeNode) selectedNode.getParent()).getUserObject();
if (parentObj instanceof PortfolioStructure) {
artefactClicked = (AbstractArtefact) userObj;
PortfolioStructure structure = (PortfolioStructure) parentObj;
refreshAddElements(ureq, null);
delButton.setVisible(true);
fireEvent(ureq, new EPArtefactClicked(ARTEFACT_NODE_CLICKED, structure));
}
} else {
// root tree node clicked, no add/delete link
delButton.setVisible(false);
refreshAddElements(ureq, null);
fireEvent(ureq, new Event(ARTEFACT_NODE_CLICKED));
}
}
Aggregations