Search in sources :

Example 76 with SelectionEvent

use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project openolat by klemens.

the class AbstractBusinessGroupListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (createButton == source) {
        doCreate(ureq, getWindowControl(), null);
    } else if (deleteButton == source) {
        confirmDelete(ureq, getSelectedItems());
    } else if (duplicateButton == source) {
        doCopy(ureq, getSelectedItems());
    } else if (configButton == source) {
        doConfiguration(ureq, getSelectedItems());
    } else if (emailButton == source) {
        doEmails(ureq, getSelectedItems());
    } else if (usersButton == source) {
        doUserManagement(ureq, getSelectedItems());
    } else if (mergeButton == source) {
        doMerge(ureq, getSelectedItems());
    } else if (selectButton == source) {
        doSelect(ureq, getSelectedItems());
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        if ("mark".equals(cmd)) {
            BusinessGroupRow row = (BusinessGroupRow) link.getUserObject();
            boolean marked = toogleMark(row);
            link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg");
            link.getComponent().setDirty(true);
        } else if ("allresources".equals(cmd)) {
            BusinessGroupShort bg = (BusinessGroupShort) link.getUserObject();
            NewControllerFactory.getInstance().launch("[BusinessGroup:" + bg.getKey() + "][toolresources:0]", ureq, getWindowControl());
        } else if ("resource".equals(cmd)) {
            RepositoryEntryShort re = (RepositoryEntryShort) link.getUserObject();
            NewControllerFactory.getInstance().launch("[RepositoryEntry:" + re.getKey() + "]", ureq, getWindowControl());
        } else if (link.getUserObject() instanceof BusinessGroupRef) {
            BusinessGroupRef item = (BusinessGroupRef) link.getUserObject();
            Long businessGroupKey = item.getKey();
            BusinessGroup businessGroup = businessGroupService.loadBusinessGroup(businessGroupKey);
            if (businessGroup == null) {
                groupTableModel.removeBusinessGroup(businessGroupKey);
                tableEl.reset();
            } else if (TABLE_ACTION_ACCESS.equals(cmd)) {
                doAccess(ureq, businessGroup);
            } else if (TABLE_ACTION_LEAVE.equals(cmd)) {
                doConfirmLeaving(ureq, businessGroup);
            }
        }
    } else if (source == tableEl) {
        String cmd = event.getCommand();
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            if (se.getIndex() >= 0 && se.getIndex() < groupTableModel.getRowCount()) {
                BusinessGroupRef item = groupTableModel.getObject(se.getIndex());
                Long businessGroupKey = item.getKey();
                BusinessGroup businessGroup = businessGroupService.loadBusinessGroup(businessGroupKey);
                // prevent rs after a group is deleted by someone else
                if (businessGroup == null) {
                    groupTableModel.removeBusinessGroup(businessGroupKey);
                    tableEl.reset();
                } else if (TABLE_ACTION_LAUNCH.equals(cmd)) {
                    doLaunch(ureq, businessGroup);
                } else if (TABLE_ACTION_DELETE.equals(cmd)) {
                    confirmDelete(ureq, Collections.singletonList(item));
                } else if (TABLE_ACTION_LAUNCH.equals(cmd)) {
                    doLaunch(ureq, businessGroup);
                } else if (TABLE_ACTION_EDIT.equals(cmd)) {
                    doEdit(ureq, businessGroup);
                } else if (TABLE_ACTION_LEAVE.equals(cmd)) {
                    doConfirmLeaving(ureq, businessGroup);
                } else if (TABLE_ACTION_ACCESS.equals(cmd)) {
                    doAccess(ureq, businessGroup);
                } else if (TABLE_ACTION_SELECT.equals(cmd)) {
                    doSelect(ureq, businessGroup);
                }
            }
        } else if (event instanceof FlexiTableSearchEvent) {
            doSearch((FlexiTableSearchEvent) event);
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : BusinessGroupRef(org.olat.group.BusinessGroupRef) RepositoryEntryShort(org.olat.repository.RepositoryEntryShort) BGCopyBusinessGroup(org.olat.group.ui.wizard.BGCopyBusinessGroup) BGConfigBusinessGroup(org.olat.group.ui.wizard.BGConfigBusinessGroup) BusinessGroup(org.olat.group.BusinessGroup) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) BusinessGroupSelectionEvent(org.olat.group.model.BusinessGroupSelectionEvent) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) BusinessGroupShort(org.olat.group.BusinessGroupShort) BusinessGroupRow(org.olat.group.model.BusinessGroupRow)

Example 77 with SelectionEvent

use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project openolat by klemens.

the class CorrectionIdentityAssessmentItemListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("select".equals(cmd)) {
                CorrectionIdentityAssessmentItemRow row = tableModel.getObject(se.getIndex());
                doSelect(ureq, row);
            }
        }
    } else if (saveButton == source) {
        List<AssessmentTestSession> sessions = Collections.singletonList(candidateSession);
        AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
        fireEvent(ureq, new CompleteAssessmentTestSessionEvent(sessions, assessmentTest, AssessmentEntryStatus.done));
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : ResolvedAssessmentTest(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest) AssessmentTest(uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest) CorrectionIdentityAssessmentItemRow(org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityAssessmentItemRow) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) CompleteAssessmentTestSessionEvent(org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent) List(java.util.List) ArrayList(java.util.ArrayList)

Example 78 with SelectionEvent

use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project openolat by klemens.

the class CorrectionIdentityListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("select".equals(cmd)) {
                CorrectionIdentityRow row = tableModel.getObject(se.getIndex());
                doSelect(ureq, row);
            }
        }
    } else if (saveTestsButton == source) {
        doConfirmSaveTests(ureq);
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) CorrectionIdentityRow(org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityRow)

Example 79 with SelectionEvent

use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project openolat by klemens.

the class IdentityAssessmentOverviewController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            AssessmentNodeData nodeData = tableModel.getObject(se.getIndex());
            if (CMD_SELECT_NODE.equals(cmd)) {
                CourseNode node = runStructure.getNode(nodeData.getIdent());
                selectedCourseNode = (AssessableCourseNode) node;
                fireEvent(ureq, EVENT_NODE_SELECTED);
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) CourseNode(org.olat.course.nodes.CourseNode) AssessmentNodeData(org.olat.course.assessment.model.AssessmentNodeData)

Example 80 with SelectionEvent

use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project openolat by klemens.

the class CertificateAndEfficiencyStatementListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent te = (SelectionEvent) event;
            String cmd = te.getCommand();
            CertificateAndEfficiencyStatement statement = tableModel.getObject(te.getIndex());
            if (CMD_LAUNCH_COURSE.equals(cmd)) {
                doLaunchCourse(ureq, statement.getResourceKey());
            } else if (CMD_DELETE.equals(cmd)) {
                doConfirmDelete(ureq, statement);
            } else if (CMD_SHOW.equals(cmd)) {
                doShowStatement(ureq, statement);
            } else if (CMD_ARTEFACT.equals(cmd)) {
                doCollectArtefact(ureq, statement.getDisplayName(), statement.getEfficiencyStatementKey());
            } else if (CMD_MEDIA.equals(cmd)) {
                doCollectMedia(ureq, statement.getDisplayName(), statement.getEfficiencyStatementKey());
            }
        }
    } else if (coachingToolButton == source) {
        doLaunchCoachingTool(ureq);
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : CertificateAndEfficiencyStatement(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementListModel.CertificateAndEfficiencyStatement) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)

Aggregations

SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)170 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)54 FlexiTableSearchEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent)28 ArrayList (java.util.ArrayList)14 List (java.util.List)14 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)10 MultipleSelectionElement (org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)6 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)6 FlexiTableRenderEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableRenderEvent)6 Identity (org.olat.core.id.Identity)6 CourseNode (org.olat.course.nodes.CourseNode)6 EfficiencyStatementEntry (org.olat.modules.coach.model.EfficiencyStatementEntry)6 GoToMeeting (org.olat.modules.gotomeeting.GoToMeeting)5 PortfolioElementRow (org.olat.modules.portfolio.ui.model.PortfolioElementRow)5 Set (java.util.Set)4 AssessmentNodeData (org.olat.course.assessment.model.AssessmentNodeData)4 Checkbox (org.olat.course.nodes.cl.model.Checkbox)4 SentReminderRow (org.olat.course.reminder.model.SentReminderRow)4 UserSelectionEvent (org.olat.modules.assessment.ui.event.UserSelectionEvent)4 Pool (org.olat.modules.qpool.Pool)4