Search in sources :

Example 31 with SelectionEvent

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

the class AuthorListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (addOwnersButton == source) {
        List<AuthoringEntryRow> rows = getMultiSelectedRows();
        if (!rows.isEmpty()) {
            doAddOwners(ureq, rows);
        } else {
            showWarning("bulk.update.nothing.selected");
        }
    } else if (sendMailButton == source) {
        List<AuthoringEntryRow> rows = getMultiSelectedRows();
        if (!rows.isEmpty()) {
            doSendMail(ureq, rows);
        } else {
            showWarning("bulk.update.nothing.selected");
        }
    } else if (copyButton == source) {
        List<AuthoringEntryRow> rows = getMultiSelectedRows();
        if (!rows.isEmpty()) {
            doConfirmCopy(ureq, rows);
        } else {
            showWarning("bulk.update.nothing.selected");
        }
    } else if (deleteButton == source) {
        List<AuthoringEntryRow> rows = getMultiSelectedRows();
        if (!rows.isEmpty()) {
            doDelete(ureq, rows);
        } else {
            showWarning("bulk.update.nothing.selected");
        }
    } else if (closedEl == source) {
        doSetClosedFilter();
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        if ("mark".equals(cmd)) {
            AuthoringEntryRow row = (AuthoringEntryRow) link.getUserObject();
            boolean marked = doMark(ureq, row);
            link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg");
            link.setTitle(translate(marked ? "details.bookmark.remove" : "details.bookmark"));
            link.getComponent().setDirty(true);
            row.setMarked(marked);
        } else if ("tools".equals(cmd)) {
            AuthoringEntryRow row = (AuthoringEntryRow) link.getUserObject();
            doOpenTools(ureq, row, link);
        } else if ("references".equals(cmd)) {
            AuthoringEntryRow row = (AuthoringEntryRow) link.getUserObject();
            doOpenReferences(ureq, row, link);
        }
    } else if (source == tableEl) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            AuthoringEntryRow row = model.getObject(se.getIndex());
            if ("details".equals(cmd)) {
                launchDetails(ureq, row);
            } else if ("edit".equals(cmd)) {
                launchEditor(ureq, row);
            } else if ("select".equals(cmd)) {
                launch(ureq, row);
            }
        } else if (event instanceof FlexiTableSearchEvent) {
            AuthorListState stateEntry = new AuthorListState();
            stateEntry.setTableState(tableEl.getStateEntry());
            addToHistory(ureq, stateEntry);
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent) List(java.util.List) ArrayList(java.util.ArrayList) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 32 with SelectionEvent

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

the class CatalogNodeManagerController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (entriesEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if (cmd != null && cmd.startsWith("opened-")) {
                CatalogEntryRow row = entriesModel.getObject(se.getIndex());
                if ("opened-details".equals(cmd) || "opened-select".equals(cmd)) {
                    launchDetails(ureq, row);
                } else if ("opened-move".equals(cmd)) {
                    doMoveCategory(ureq, row);
                } else if ("opened-delete".equals(cmd)) {
                    doConfirmDelete(ureq, row);
                }
            }
        }
    } else if (closedEntriesEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if (cmd != null && cmd.startsWith("closed-")) {
                CatalogEntryRow row = closedEntriesModel.getObject(se.getIndex());
                if ("closed-details".equals(cmd) || "closed-select".equals(cmd)) {
                    launchDetails(ureq, row);
                } else if ("closed-move".equals(cmd)) {
                    doMoveCategory(ureq, row);
                } else if ("closed-delete".equals(cmd)) {
                    doConfirmDelete(ureq, row);
                }
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)

Example 33 with SelectionEvent

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

the class RepositoryEntryListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source instanceof RatingWithAverageFormItem && event instanceof RatingFormEvent) {
        RatingFormEvent ratingEvent = (RatingFormEvent) event;
        RatingWithAverageFormItem ratingItem = (RatingWithAverageFormItem) source;
        RepositoryEntryRow row = (RepositoryEntryRow) ratingItem.getUserObject();
        doRating(row, ratingEvent.getRating());
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        if ("mark".equals(cmd)) {
            RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
            boolean marked = doMark(ureq, row);
            link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg");
            link.setTitle(translate(marked ? "details.bookmark.remove" : "details.bookmark"));
            link.getComponent().setDirty(true);
            row.setMarked(marked);
        } else if ("start".equals(cmd)) {
            RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
            doOpen(ureq, row, null);
        } else if ("details".equals(cmd)) {
            RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
            doOpenDetails(ureq, row);
        } else if ("select".equals(cmd)) {
            RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
            if (row.isMember()) {
                doOpen(ureq, row, null);
            } else {
                doOpenDetails(ureq, row);
            }
        } else if ("comments".equals(cmd)) {
            RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
            doOpenComments(ureq, row);
        }
    } else if (source == tableEl) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            RepositoryEntryRow row = model.getObject(se.getIndex());
            if ("select".equals(cmd)) {
                if (row.isMember()) {
                    doOpen(ureq, row, null);
                } else {
                    doOpenDetails(ureq, row);
                }
            }
        } else if (event instanceof FlexiTableSearchEvent) {
            RepositoryEntryListState state = new RepositoryEntryListState();
            state.setTableState(tableEl.getStateEntry());
            addToHistory(ureq, state);
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : RatingWithAverageFormItem(org.olat.core.gui.components.rating.RatingWithAverageFormItem) RatingFormEvent(org.olat.core.gui.components.rating.RatingFormEvent) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 34 with SelectionEvent

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

the class GoToMeetingsController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (upcomingTableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            if ("select-upcoming".equals(se.getCommand())) {
                GoToMeeting meeting = upcomingTableModel.getObject(se.getIndex());
                fireEvent(ureq, new SelectGoToMeetingEvent(meeting));
            }
        }
    } else if (pastTableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            if ("select-past".equals(se.getCommand())) {
                GoToMeeting meeting = pastTableModel.getObject(se.getIndex());
                fireEvent(ureq, new SelectGoToMeetingEvent(meeting));
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : GoToMeeting(org.olat.modules.gotomeeting.GoToMeeting) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)

Example 35 with SelectionEvent

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

the class GoToOrganizerListAdminController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (addOrganizerButton == source) {
        doAddOrganizer(ureq);
    } else if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            if ("renew".equals(se.getCommand())) {
                GoToOrganizer organizer = tableModel.getObject(se.getIndex());
                doRenewOrganizer(ureq, organizer);
            } else if ("remove".equals(se.getCommand())) {
                GoToOrganizer organizer = tableModel.getObject(se.getIndex());
                doConfirmRemove(ureq, organizer);
            } else if ("owner".equals(se.getCommand())) {
                GoToOrganizer organizer = tableModel.getObject(se.getIndex());
                doOpenOwner(ureq, organizer);
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer) 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