Search in sources :

Example 81 with Controller

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());
        }
    }
}
Also used : UserComment(org.olat.core.commons.services.commentAndRating.model.UserComment) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) DialogBoxController(org.olat.core.gui.control.generic.modal.DialogBoxController) TitledWrapperController(org.olat.core.gui.control.generic.title.TitledWrapperController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController)

Example 82 with Controller

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());
        }
    }
}
Also used : UserComment(org.olat.core.commons.services.commentAndRating.model.UserComment) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController)

Example 83 with Controller

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;
}
Also used : VetoableCloseController(org.olat.core.gui.control.VetoableCloseController) Controller(org.olat.core.gui.control.Controller) Link(org.olat.core.gui.components.link.Link)

Example 84 with 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;
}
Also used : VetoableCloseController(org.olat.core.gui.control.VetoableCloseController) Controller(org.olat.core.gui.control.Controller) Link(org.olat.core.gui.components.link.Link)

Example 85 with 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();
        }
    }
}
Also used : DialogBoxController(org.olat.core.gui.control.generic.modal.DialogBoxController) Controller(org.olat.core.gui.control.Controller) DefaultController(org.olat.core.gui.control.DefaultController) MapperService(org.olat.core.dispatcher.mapper.MapperService)

Aggregations

Controller (org.olat.core.gui.control.Controller)372 BasicController (org.olat.core.gui.control.controller.BasicController)114 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)82 NodeEditController (org.olat.course.editor.NodeEditController)82 WindowControl (org.olat.core.gui.control.WindowControl)78 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)74 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)62 RepositoryEntry (org.olat.repository.RepositoryEntry)60 Translator (org.olat.core.gui.translator.Translator)54 UserRequest (org.olat.core.gui.UserRequest)52 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)50 OLATResourceable (org.olat.core.id.OLATResourceable)46 ArrayList (java.util.ArrayList)40 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)40 MainLayoutBasicController (org.olat.core.gui.control.controller.MainLayoutBasicController)36 Component (org.olat.core.gui.components.Component)34 Roles (org.olat.core.id.Roles)34 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)32 FormBasicController (org.olat.core.gui.components.form.flexible.impl.FormBasicController)30 ContextEntry (org.olat.core.id.context.ContextEntry)30