Search in sources :

Example 56 with SelectionEvent

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

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 57 with SelectionEvent

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

the class PoolsController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == poolTable) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            if ("select-pool".equals(se.getCommand())) {
                Pool row = model.getObject(se.getIndex());
                fireEvent(ureq, new QPoolSelectionEvent(Collections.singletonList(row)));
            }
        }
    } else if (source == selectButton) {
        Set<Integer> selectIndexes = poolTable.getMultiSelectedIndex();
        if (!selectIndexes.isEmpty()) {
            List<Pool> rows = new ArrayList<Pool>(selectIndexes.size());
            for (Integer index : selectIndexes) {
                Pool row = model.getObject(index.intValue());
                rows.add(row);
            }
            fireEvent(ureq, new QPoolSelectionEvent(rows));
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : Set(java.util.Set) QPoolSelectionEvent(org.olat.modules.qpool.ui.events.QPoolSelectionEvent) QPoolSelectionEvent(org.olat.modules.qpool.ui.events.QPoolSelectionEvent) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) Pool(org.olat.modules.qpool.Pool) ArrayList(java.util.ArrayList) List(java.util.List)

Example 58 with SelectionEvent

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

the class VideoAdminTranscodingController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == transcodingTable) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            TranscodingRow currentObject = tableModel.getObject(se.getIndex());
            if ("quality.delete".equals(se.getCommand())) {
                queueDeleteTranscoding(currentObject);
                showInfo("delete.transcodings");
            } else if ("quality.transcode".equals(se.getCommand())) {
                queueCreateTranscoding(currentObject);
                showInfo("info.transcoding");
            }
        }
    }
    reloadTable();
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)

Example 59 with SelectionEvent

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

the class TaxonomyTreeTableController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (newLevelButton == source) {
        doNewLevel(ureq);
    } else if (deleteButton == source) {
        doConfirmMultiDelete(ureq);
    } else if (mergeButton == source) {
        doMerge(ureq);
    } else if (typeButton == source) {
        doAssignType(ureq);
    } else if (moveButton == source) {
        doMove(ureq);
    } else if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("select".equals(cmd)) {
                TaxonomyLevelRow row = model.getObject(se.getIndex());
                doSelectTaxonomyLevel(ureq, row);
            }
        } else if (event instanceof FlexiTableSearchEvent) {
            loadModel(true, true);
        }
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        if ("tools".equals(cmd)) {
            TaxonomyLevelRow row = (TaxonomyLevelRow) link.getUserObject();
            doOpenTools(ureq, row, link);
        }
    }
    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) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 60 with SelectionEvent

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

the class LifecycleAdminController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == createLifeCycle) {
        doEdit(ureq, null);
    } else if (source == tableEl) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            if ("delete-lifecycle".equals(se.getCommand())) {
                RepositoryEntryLifecycle row = model.getObject(se.getIndex());
                doConfirmDelete(ureq, row);
            } else if ("edit-lifecycle".equals(se.getCommand())) {
                RepositoryEntryLifecycle row = model.getObject(se.getIndex());
                doEdit(ureq, row);
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : RepositoryEntryLifecycle(org.olat.repository.model.RepositoryEntryLifecycle) 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