Search in sources :

Example 21 with Component

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

the class DocumentPoolAdminController 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 == configurationLink) {
                doOpenConfiguration(ureq);
            } else if (clickedLink == permissionsLink) {
                doOpenPermissions(ureq);
            } else if (clickedLink == infosPageLink) {
                doOpenInfosPage(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 22 with Component

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

the class QuestionItemDetailsController method initStatusTools.

private void initStatusTools() {
    Component statusCmp;
    if (canChangeStatus()) {
        statusCmp = buildStatusDrowdown();
    } else {
        statusCmp = buildStatusLink();
    }
    stackPanel.addTool(statusCmp, Align.left);
}
Also used : Component(org.olat.core.gui.components.Component)

Example 23 with Component

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

the class QuestionPoolAdminController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == segmentView && event instanceof SegmentViewEvent) {
        SegmentViewEvent sve = (SegmentViewEvent) event;
        String segmentCName = sve.getComponentName();
        Component clickedLink = mainVC.getComponent(segmentCName);
        if (clickedLink == configurationLink) {
            doOpenConfiguration(ureq);
        } else if (clickedLink == infoPageLink) {
            doOpenInfosPage(ureq);
        } else if (clickedLink == reviewProcessLink) {
            doOpenReviewProcess(ureq);
        } else if (clickedLink == taxonomyLink) {
            doOpenTaxonomy(ureq);
        } else if (clickedLink == poolsLink) {
            doOpenPools(ureq);
        } else if (clickedLink == itemTypesLink) {
            doOpenItemTypes(ureq);
        } else if (clickedLink == educationalContextLink) {
            doOpenEducationalContext(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 24 with Component

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

the class QuestionItemPreviewController method updateItem.

public void updateItem(UserRequest ureq, QuestionItem updatedItem) {
    this.item = updatedItem;
    removeAsListenerAndDispose(previewCtrl);
    if (updatedItem == null) {
        previewCtrl = null;
        previewPanel.setContent(null);
    } else {
        Component content;
        QPoolSPI spi = poolModule.getQuestionPoolProvider(updatedItem.getFormat());
        if (spi == null) {
            content = getRawContent();
        } else {
            previewCtrl = spi.getPreviewController(ureq, getWindowControl(), updatedItem, true);
            if (previewCtrl == null) {
                content = getRawContent();
            } else {
                listenTo(previewCtrl);
                content = previewCtrl.getInitialComponent();
            }
        }
        previewPanel.setContent(content);
    }
}
Also used : QPoolSPI(org.olat.modules.qpool.QPoolSPI) Component(org.olat.core.gui.components.Component)

Example 25 with Component

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

the class OverviewRepositoryListController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == segmentView) {
        if (event instanceof SegmentViewEvent) {
            cleanUp();
            SegmentViewEvent sve = (SegmentViewEvent) event;
            String segmentCName = sve.getComponentName();
            Component clickedLink = mainVC.getComponent(segmentCName);
            if (clickedLink == favoriteLink) {
                doOpenMark(ureq);
            } else if (clickedLink == myCourseLink) {
                doOpenMyCourses(ureq);
            } else if (clickedLink == catalogLink) {
                doOpenCatalog(ureq);
            } else if (clickedLink == searchCourseLink) {
                doOpenSearchCourses(ureq);
            } else if (clickedLink == closedCourseLink) {
                doOpenClosedCourses(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)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