Search in sources :

Example 91 with Component

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

the class ViteroAdminController 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 == accountLink) {
                doOpenAccountSettings(ureq);
            } else if (clickedLink == bookingsLink) {
                doOpenBookings(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 92 with Component

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

the class ViteroBookingsRunController 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 == bookingsLink) {
                doOpenBookings(ureq);
            } else if (clickedLink == adminLink) {
                doOpenAdmin(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 93 with Component

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

the class UserSettingsController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.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 == preferencesLink) {
                doOpenPreferences(ureq);
            } else if (clickedLink == webdavLink) {
                doOpenWebDAV(ureq);
            } else if (clickedLink == imLink) {
                doOpenIM(ureq);
            } else if (clickedLink == disclaimerLink) {
                doOpenDisclaimer(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 94 with Component

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

the class UserInterestsRenderer method render.

@Override
public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderResult renderResult, String[] args) {
    UserInterestsComponent uiCmp = (UserInterestsComponent) source;
    UserInterestsElement uiFte = uiCmp.getUserInterestsElement();
    List<String> userInterests = uiFte.getUserInterests();
    if (userInterests.size() > 0) {
        sb.append("<ul class='list-unstyled'>");
        for (String userInterest : userInterests) {
            sb.append("<li>").append(userInterest).append("</li>");
        }
        sb.append("</ul>");
    }
    FormLink editLink = uiFte.getEditLink();
    if (editLink != null && editLink.isVisible()) {
        Component cmp = editLink.getComponent();
        cmp.getHTMLRendererSingleton().render(renderer, sb, cmp, ubu, translator, renderResult, args);
    }
}
Also used : FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) Component(org.olat.core.gui.components.Component)

Example 95 with Component

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

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)

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