Search in sources :

Example 1 with ReminderRow

use of org.olat.course.reminder.model.ReminderRow in project OpenOLAT by OpenOLAT.

the class CourseReminderListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (addButton == source) {
        doAddReminder(ureq);
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        if ("tools".equals(cmd)) {
            ReminderRow row = (ReminderRow) link.getUserObject();
            doOpenTools(ureq, row, link);
        }
    } else if (source == tableEl) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            ReminderRow row = tableModel.getObject(se.getIndex());
            if ("edit".equals(cmd)) {
                doEdit(ureq, row);
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : ReminderRow(org.olat.course.reminder.model.ReminderRow) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 2 with ReminderRow

use of org.olat.course.reminder.model.ReminderRow in project OpenOLAT by OpenOLAT.

the class CourseReminderListController method updateModel.

private void updateModel() {
    List<ReminderInfos> reminders = reminderManager.getReminderInfos(repositoryEntry);
    List<ReminderRow> rows = new ArrayList<>(reminders.size());
    for (ReminderInfos reminder : reminders) {
        FormLink toolsLink = uifactory.addFormLink("tools_" + counter.incrementAndGet(), "tools", "", null, null, Link.NONTRANSLATED);
        toolsLink.setIconLeftCSS("o_icon o_icon_actions o_icon-lg");
        toolsLink.setElementCssClass("o_sel_course_reminder_tools");
        toolsLink.setTitle(translate("tools"));
        ReminderRow row = new ReminderRow(reminder, toolsLink);
        toolsLink.setUserObject(row);
        rows.add(row);
    }
    tableModel.setObjects(rows);
    tableEl.reset();
    tableEl.setVisible(rows.size() > 0);
}
Also used : ReminderInfos(org.olat.modules.reminder.model.ReminderInfos) ReminderRow(org.olat.course.reminder.model.ReminderRow) ArrayList(java.util.ArrayList) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 3 with ReminderRow

use of org.olat.course.reminder.model.ReminderRow in project openolat by klemens.

the class CourseReminderListController method updateModel.

private void updateModel() {
    List<ReminderInfos> reminders = reminderManager.getReminderInfos(repositoryEntry);
    List<ReminderRow> rows = new ArrayList<>(reminders.size());
    for (ReminderInfos reminder : reminders) {
        FormLink toolsLink = uifactory.addFormLink("tools_" + counter.incrementAndGet(), "tools", "", null, null, Link.NONTRANSLATED);
        toolsLink.setIconLeftCSS("o_icon o_icon_actions o_icon-lg");
        toolsLink.setElementCssClass("o_sel_course_reminder_tools");
        toolsLink.setTitle(translate("tools"));
        ReminderRow row = new ReminderRow(reminder, toolsLink);
        toolsLink.setUserObject(row);
        rows.add(row);
    }
    tableModel.setObjects(rows);
    tableEl.reset();
    tableEl.setVisible(rows.size() > 0);
}
Also used : ReminderInfos(org.olat.modules.reminder.model.ReminderInfos) ReminderRow(org.olat.course.reminder.model.ReminderRow) ArrayList(java.util.ArrayList) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 4 with ReminderRow

use of org.olat.course.reminder.model.ReminderRow in project openolat by klemens.

the class CourseReminderListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (addButton == source) {
        doAddReminder(ureq);
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        if ("tools".equals(cmd)) {
            ReminderRow row = (ReminderRow) link.getUserObject();
            doOpenTools(ureq, row, link);
        }
    } else if (source == tableEl) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            ReminderRow row = tableModel.getObject(se.getIndex());
            if ("edit".equals(cmd)) {
                doEdit(ureq, row);
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : ReminderRow(org.olat.course.reminder.model.ReminderRow) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Aggregations

FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)4 ReminderRow (org.olat.course.reminder.model.ReminderRow)4 ArrayList (java.util.ArrayList)2 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)2 ReminderInfos (org.olat.modules.reminder.model.ReminderInfos)2