Search in sources :

Example 76 with SegmentViewEvent

use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project openolat by klemens.

the class TrashController 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 == pagesLink) {
                doOpenPages(ureq);
            } else if (clickedLink == bindersLink) {
                doOpenBinders(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 77 with SegmentViewEvent

use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project openolat by klemens.

the class MultiEvaluationFormController 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 == ownerLink) {
                doOpenEvalutationForm(ureq, owner);
            } else if (clickedLink == compareLink) {
                doOpenOverview(ureq);
            } else if (clickedLink instanceof Link) {
                Link link = (Link) clickedLink;
                Object uobject = link.getUserObject();
                if (uobject instanceof Identity) {
                    doOpenEvalutationForm(ureq, (Identity) uobject);
                }
            }
        }
    }
}
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) Identity(org.olat.core.id.Identity) Link(org.olat.core.gui.components.link.Link)

Example 78 with SegmentViewEvent

use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project openolat by klemens.

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 79 with SegmentViewEvent

use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project openolat by klemens.

the class VideoAdminController 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 == adminSetLink) {
                doOpenAdminConfig(ureq);
            } else if (clickedLink == adminListLink) {
                doOpenAdminList(ureq);
            } else if (clickedLink == adminTranscodingLink) {
                doOpenTranscodingAdmin(ureq);
            } else if (clickedLink == adminErrorLink) {
                doOpenErrorAdmin(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 80 with SegmentViewEvent

use of org.olat.core.gui.components.segmentedview.SegmentViewEvent in project openolat by klemens.

the class VideoSettingsController 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 == metaDataLink) {
                doOpenMetaDataConfig(ureq);
            } else if (clickedLink == posterEditLink) {
                doOpenPosterConfig(ureq);
            } else if (clickedLink == trackEditLink) {
                doOpenTrackConfig(ureq);
            } else if (clickedLink == qualityConfig) {
                doOpenQualityConfig(ureq);
            } else if (clickedLink == chapterEditLink) {
                doOpenChapterConfig(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)

Aggregations

Component (org.olat.core.gui.components.Component)90 SegmentViewComponent (org.olat.core.gui.components.segmentedview.SegmentViewComponent)90 SegmentViewEvent (org.olat.core.gui.components.segmentedview.SegmentViewEvent)90 Link (org.olat.core.gui.components.link.Link)4 Controller (org.olat.core.gui.control.Controller)4 BasicController (org.olat.core.gui.control.controller.BasicController)4 Statistics (org.hibernate.stat.Statistics)2 PopEvent (org.olat.core.gui.components.stack.PopEvent)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 Identity (org.olat.core.id.Identity)2 RepositoryHandler (org.olat.repository.handlers.RepositoryHandler)2 ImportRepositoryEntryController (org.olat.repository.ui.author.ImportRepositoryEntryController)2