Search in sources :

Example 41 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class ReferencableEntriesSearchController method event.

@Override
public void event(UserRequest ureq, Component source, Event event) {
    if (source == segmentView) {
        if (event instanceof SegmentViewEvent) {
            SegmentViewEvent sve = (SegmentViewEvent) event;
            String segmentCName = sve.getComponentName();
            Component clickedLink = mainVC.getComponent(segmentCName);
            if (clickedLink == myEntriesLink) {
                searchCtr.doSearchByOwnerLimitType(ureq.getIdentity(), limitTypes);
            } else if (clickedLink == allEntriesLink) {
                switch(canBe) {
                    case referenceable:
                        searchCtr.doSearchForReferencableResourcesLimitType(ureq.getIdentity(), limitTypes, ureq.getUserSession().getRoles());
                        break;
                    case copyable:
                        searchCtr.doSearchForCopyableResourcesLimitType(ureq.getIdentity(), limitTypes, ureq.getUserSession().getRoles());
                        break;
                    case all:
                        searchCtr.doSearchByTypeLimitAccess(limitTypes, ureq);
                        break;
                }
            } else if (clickedLink == searchEntriesLink) {
                searchCtr.displaySearchForm();
            } else if (clickedLink == adminEntriesLink) {
                searchCtr.displayAdminSearchForm();
            }
            mainVC.setDirty(true);
        }
    } else if (source == createRessourceCmp || (source instanceof Link && ((Link) source).getUserObject() instanceof RepositoryHandler)) {
        removeAsListenerAndDispose(cmc);
        removeAsListenerAndDispose(createController);
        RepositoryHandler handler = (RepositoryHandler) ((Link) source).getUserObject();
        createController = handler.createCreateRepositoryEntryController(ureq, getWindowControl());
        listenTo(createController);
        String title = translate(handler.getCreateLabelI18nKey());
        cmc = new CloseableModalController(getWindowControl(), translate("close"), createController.getInitialComponent(), true, title);
        cmc.setCustomWindowCSS("o_sel_author_create_popup");
        listenTo(cmc);
        cmc.activate();
    } else if (source == importRessourceButton) {
        removeAsListenerAndDispose(importController);
        importController = new ImportRepositoryEntryController(ureq, getWindowControl(), limitTypes);
        listenTo(importController);
        removeAsListenerAndDispose(cmc);
        cmc = new CloseableModalController(getWindowControl(), translate("close"), importController.getInitialComponent(), true, "");
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : SegmentViewEvent(org.olat.core.gui.components.segmentedview.SegmentViewEvent) ImportRepositoryEntryController(org.olat.repository.ui.author.ImportRepositoryEntryController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) RepositoryHandler(org.olat.repository.handlers.RepositoryHandler) Component(org.olat.core.gui.components.Component) SegmentViewComponent(org.olat.core.gui.components.segmentedview.SegmentViewComponent) Link(org.olat.core.gui.components.link.Link)

Example 42 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class GTARunController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == segmentView) {
        if (event instanceof SegmentViewEvent) {
            SegmentViewEvent sve = (SegmentViewEvent) event;
            String segmentCName = sve.getComponentName();
            Component clickedLink = mainVC.getComponent(segmentCName);
            if (clickedLink == runLink) {
                doOpenRun(ureq);
            } else if (clickedLink == coachLink) {
                doOpenCoach(ureq);
            } else if (clickedLink == markedLink) {
                doOpenMarked(ureq);
            } else if (clickedLink == manageLink) {
                doManage(ureq);
            }
        }
    }
}
Also used : SegmentViewEvent(org.olat.core.gui.components.segmentedview.SegmentViewEvent) Component(org.olat.core.gui.components.Component) SegmentViewComponent(org.olat.core.gui.components.segmentedview.SegmentViewComponent)

Example 43 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class TaxonomyLevelOverviewController method initTabPane.

private void initTabPane() {
    tabPane.addTab(translate("taxonomy.level.competences"), new TabCreator() {

        @Override
        public Component create(UserRequest uureq) {
            competencesCtrl = new TaxonomyLevelCompetenceController(uureq, getWindowControl(), taxonomyLevel);
            listenTo(competencesCtrl);
            return competencesCtrl.getInitialComponent();
        }
    });
    tabPane.addTab(translate("taxonomy.level.relations"), new TabCreator() {

        @Override
        public Component create(UserRequest uureq) {
            relationsCtrl = new TaxonomyLevelRelationsController(uureq, getWindowControl(), taxonomyLevel);
            listenTo(relationsCtrl);
            return relationsCtrl.getInitialComponent();
        }
    });
}
Also used : TabCreator(org.olat.core.gui.components.tabbedpane.TabCreator) Component(org.olat.core.gui.components.Component) UserRequest(org.olat.core.gui.UserRequest)

Example 44 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class ProfileAndHomePageEditController method event.

@Override
public void event(UserRequest ureq, Component source, Event event) {
    if (source == segmentView) {
        if (event instanceof SegmentViewEvent) {
            SegmentViewEvent sve = (SegmentViewEvent) event;
            String segmentCName = sve.getComponentName();
            Component clickedLink = myContent.getComponent(segmentCName);
            Controller selectedController = null;
            if (clickedLink == profilLink) {
                selectedController = doOpenProfile(ureq);
            } else if (clickedLink == homePageLink) {
                selectedController = doOpenHomePageSettings(ureq);
            }
            addToHistory(ureq, selectedController);
        }
    }
}
Also used : SegmentViewEvent(org.olat.core.gui.components.segmentedview.SegmentViewEvent) Component(org.olat.core.gui.components.Component) SegmentViewComponent(org.olat.core.gui.components.segmentedview.SegmentViewComponent) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController)

Example 45 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class AbstractBusinessGroupListController method confirmUserManagementEmail.

private void confirmUserManagementEmail(UserRequest ureq, MembershipModification mod, List<BusinessGroup> groups) {
    removeAsListenerAndDispose(cmc);
    removeAsListenerAndDispose(userManagementSendMailController);
    MailTemplate defaultTemplate = null;
    int totalModification = (mod.size() * groups.size());
    if (totalModification == 1) {
        MailType type = BusinessGroupMailing.getDefaultTemplateType(mod);
        if (type != null) {
            defaultTemplate = BusinessGroupMailing.getDefaultTemplate(type, groups.get(0), ureq.getIdentity());
        }
    }
    MailTemplate template = new BGUserMailTemplate(groups, mod, defaultTemplate);
    boolean mandatoryEmail = !mod.getAddParticipants().isEmpty() && groupModule.isMandatoryEnrolmentEmail(ureq.getUserSession().getRoles());
    userManagementSendMailController = new BGMailNotificationEditController(getWindowControl(), ureq, template, totalModification == 1, totalModification == 1, false, mandatoryEmail);
    Component cmp = userManagementSendMailController.getInitialComponent();
    listenTo(userManagementSendMailController);
    cmc = new CloseableModalController(getWindowControl(), translate("close"), cmp, true, translate("users.group"));
    cmc.activate();
    listenTo(cmc);
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) MailTemplate(org.olat.core.util.mail.MailTemplate) BGUserMailTemplate(org.olat.group.ui.wizard.BGUserMailTemplate) BGMailNotificationEditController(org.olat.group.ui.wizard.BGMailNotificationEditController) BGUserMailTemplate(org.olat.group.ui.wizard.BGUserMailTemplate) MailType(org.olat.group.manager.BusinessGroupMailing.MailType) Component(org.olat.core.gui.components.Component)

Aggregations

Component (org.olat.core.gui.components.Component)300 SegmentViewComponent (org.olat.core.gui.components.segmentedview.SegmentViewComponent)90 SegmentViewEvent (org.olat.core.gui.components.segmentedview.SegmentViewEvent)90 ArrayList (java.util.ArrayList)36 Controller (org.olat.core.gui.control.Controller)28 Link (org.olat.core.gui.components.link.Link)22 BasicController (org.olat.core.gui.control.controller.BasicController)22 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)22 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)18 Panel (org.olat.core.gui.components.panel.Panel)12 HighScoreRunController (org.olat.course.highscore.ui.HighScoreRunController)12 Date (java.util.Date)10 UserRequest (org.olat.core.gui.UserRequest)10 ComponentRenderer (org.olat.core.gui.components.ComponentRenderer)10 TreeNode (org.olat.core.gui.components.tree.TreeNode)10 RenderResult (org.olat.core.gui.render.RenderResult)10 StringOutput (org.olat.core.gui.render.StringOutput)10 Translator (org.olat.core.gui.translator.Translator)10 AbstractComponent (org.olat.core.gui.components.AbstractComponent)8 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)8