use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class UserCommentDisplayController method buildReplyComments.
/**
* Internal helper to build the view controller for the replies
* @param ureq
*/
private void buildReplyComments(UserRequest ureq) {
// First remove all old replies
for (Controller replyController : replyControllers) {
removeAsListenerAndDispose(replyController);
}
replyControllers.clear();
// Build replies again
for (UserComment reply : allComments) {
if (reply.getParent() == null)
continue;
if (reply.getParent().getKey().equals(userComment.getKey())) {
// Create child controller
UserCommentDisplayController replyCtr = new UserCommentDisplayController(ureq, getWindowControl(), reply, allComments, ores, resSubPath, securityCallback);
replyControllers.add(replyCtr);
listenTo(replyCtr);
userCommentDisplayVC.put(replyCtr.getViewCompName(), replyCtr.getInitialComponent());
}
}
}
use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class UserCommentsController method buildTopLevelComments.
/**
* Internal helper to build the view controller for the direct comments
* (without replies)
*
* @param ureq
* @param initDatamodel true: load datamodel from database; false: just rebuild GUI with existing datamodel
*/
private void buildTopLevelComments(UserRequest ureq, boolean initDatamodel) {
// First remove all old replies
for (Controller commentController : commentControllers) {
removeAsListenerAndDispose(commentController);
}
commentControllers.clear();
if (initDatamodel) {
allComments = commentAndRatingService.getComments(ores, resSubPath);
}
// Build replies again
for (UserComment comment : allComments) {
if (comment.getParent() == null) {
// Create top level comment controller
UserCommentDisplayController commentController = new UserCommentDisplayController(ureq, getWindowControl(), comment, allComments, ores, resSubPath, securityCallback);
commentControllers.add(commentController);
listenTo(commentController);
userCommentsVC.put(commentController.getViewCompName(), commentController.getInitialComponent());
}
}
}
use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class BreadcrumbedStackedPanel method getRootController.
@Override
public Controller getRootController() {
Controller controller = null;
if (stack.size() > 0) {
Link lastPath = stack.get(0);
BreadCrumb crumb = (BreadCrumb) lastPath.getUserObject();
controller = crumb.getController();
}
return controller;
}
use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class BreadcrumbedStackedPanel method getLastController.
public Controller getLastController() {
Controller controller = null;
if (stack.size() > 0) {
Link lastPath = stack.get(stack.size() - 1);
BreadCrumb crumb = (BreadCrumb) lastPath.getUserObject();
controller = crumb.getController();
}
return controller;
}
use of org.olat.core.gui.control.Controller in project OpenOLAT by OpenOLAT.
the class BasicController method doPreDispose.
@Override
protected void doPreDispose() {
// deregister all mappers if needed
if (mapperKeys != null) {
CoreSpringFactory.getImpl(MapperService.class).cleanUp(mapperKeys);
mapperKeys.clear();
mapperKeys = null;
}
// dispose child controller if needed
if (childControllers != null) {
for (Controller c : childControllers) {
c.dispose();
}
}
}
Aggregations