Search in sources :

Example 61 with Component

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

the class SharedItemsOverviewController 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 == favoriteLink) {
                doOpenMark(ureq);
            } else 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 62 with Component

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

the class SmsPhoneComponentRenderer method render.

@Override
public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderResult renderResult, String[] args) {
    SmsPhoneComponent smsCmp = (SmsPhoneComponent) source;
    SmsPhoneElement smsFte = smsCmp.getSmsPhoneElement();
    String id = smsCmp.getFormDispatchId();
    String phoneNumber = smsFte.getPhone();
    if (!StringHelper.containsNonWhitespace(phoneNumber)) {
        phoneNumber = smsFte.getTranslator().translate("sms.phone.not.available");
    }
    sb.append("<p id=\"").append(id).append("\" ").append(" class='form-control-static ");
    if (StringHelper.containsNonWhitespace(smsCmp.getElementCssClass())) {
        sb.append(smsCmp.getElementCssClass());
    }
    sb.append("'>").append(phoneNumber).append("</p>");
    sb.append("<div class='o_form_example help-block'>").append(smsFte.getTranslator().translate("sms.phone.hint")).append("</div>");
    if (smsFte.getAndResetFormDirty()) {
        FormJSHelper.setFlexiFormDirtyOnLoad(sb, smsFte.getRootForm());
    }
    sb.append("<div class='form-inline'>");
    FormLink editLink = smsFte.getEditLink();
    if (editLink != null && editLink.isVisible()) {
        Component cmp = editLink.getComponent();
        cmp.getHTMLRendererSingleton().render(renderer, sb, cmp, ubu, translator, renderResult, args);
    }
    if (StringHelper.containsNonWhitespace(phoneNumber)) {
        sb.append("&nbsp;");
        FormLink removeLink = smsFte.getRemoveLink();
        if (removeLink != null && removeLink.isVisible()) {
            Component cmp = removeLink.getComponent();
            cmp.getHTMLRendererSingleton().render(renderer, sb, cmp, ubu, translator, renderResult, args);
        }
    }
    sb.append("</div>");
}
Also used : FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) Component(org.olat.core.gui.components.Component)

Example 63 with Component

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

the class AssessedIdentityOverviewController 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 == checkListLink) {
                doOpenCheckList(ureq);
            } else if (clickedLink == assessmentLink) {
                doOpenAssessment(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 64 with Component

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

the class CheckListRunForCoachController 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);
            }
        }
    }
}
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 65 with Component

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

the class SelectBusinessGroupController 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 == markedGroupsLink) {
                updateMarkedGroups(ureq);
            } else if (clickedLink == ownedGroupsLink) {
                updateOwnedGroups(ureq);
            } else if (clickedLink == courseGroupsLink) {
                updateCourseGroups(ureq);
            } else if (clickedLink == searchOpenLink) {
                updateSearch(ureq);
            } else if (clickedLink == adminSearchOpenLink) {
                updateAdminSearch(ureq);
            }
        }
    } else if (createGroup == source) {
        doCreate(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