Search in sources :

Example 11 with FlexiTableSearchEvent

use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent 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 12 with FlexiTableSearchEvent

use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent 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 13 with FlexiTableSearchEvent

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

the class PaypalTransactionsController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == backLink) {
        if (detailsController != null) {
            flc.remove(detailsController.getInitialComponent());
            removeAsListenerAndDispose(detailsController);
        }
        addSearchToHistory(ureq);
    } else if (source == tableEl) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            PaypalTransaction row = dataModel.getObject(se.getIndex());
            if (CMD_SELECT.equals(se.getCommand())) {
                doSelectTransaction(ureq, row);
            }
        } else if (event instanceof FlexiTableSearchEvent) {
            FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
            doSearch(ureq, se.getSearch());
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : PaypalTransaction(org.olat.resource.accesscontrol.provider.paypal.model.PaypalTransaction) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent)

Example 14 with FlexiTableSearchEvent

use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent 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 15 with FlexiTableSearchEvent

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

the class AssessedIdentityListController 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();
            AssessedIdentityElementRow row = usersTableModel.getObject(se.getIndex());
            if ("select".equals(cmd)) {
                doSelect(ureq, row);
            }
        } else if (event instanceof FlexiTableSearchEvent) {
            FlexiTableSearchEvent ftse = (FlexiTableSearchEvent) event;
            updateModel(ftse.getSearch(), ftse.getFilters(), ftse.getExtendedFilters());
        }
    }
    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)

Aggregations

FlexiTableSearchEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent)28 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)28 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)18 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)8 ArrayList (java.util.ArrayList)4 List (java.util.List)4 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)2 RatingFormEvent (org.olat.core.gui.components.rating.RatingFormEvent)2 RatingWithAverageFormItem (org.olat.core.gui.components.rating.RatingWithAverageFormItem)2 ContactList (org.olat.core.util.mail.ContactList)2 BusinessGroup (org.olat.group.BusinessGroup)2 BusinessGroupRef (org.olat.group.BusinessGroupRef)2 BusinessGroupShort (org.olat.group.BusinessGroupShort)2 BusinessGroupRow (org.olat.group.model.BusinessGroupRow)2 BusinessGroupSelectionEvent (org.olat.group.model.BusinessGroupSelectionEvent)2 BGConfigBusinessGroup (org.olat.group.ui.wizard.BGConfigBusinessGroup)2 BGCopyBusinessGroup (org.olat.group.ui.wizard.BGCopyBusinessGroup)2 AssessedIdentityElementRow (org.olat.modules.assessment.ui.AssessedIdentityElementRow)2 StudentStatEntry (org.olat.modules.coach.model.StudentStatEntry)2 MySharedItemRow (org.olat.modules.portfolio.model.MySharedItemRow)2