Search in sources :

Example 6 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project openolat by klemens.

the class BinderListController method doOpenBinder.

protected BinderController doOpenBinder(UserRequest ureq, BinderRef row) {
    SynchedBinder binder = portfolioService.loadAndSyncBinder(row);
    if (binder.isChanged()) {
        showInfo("warning.binder.synched");
    }
    BinderController selectedBinderCtrl = doOpenBinder(ureq, binder.getBinder());
    if (row instanceof BinderRow) {
        VFSLeaf image = portfolioService.getPosterImageLeaf(binder.getBinder());
        ((BinderRow) row).setBackgroundImage(image);
    }
    return selectedBinderCtrl;
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) SynchedBinder(org.olat.modules.portfolio.model.SynchedBinder)

Example 7 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project openolat by klemens.

the class BinderListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (newBinderDropdown == source) {
        doNewBinderCallout(ureq);
    } else if (newBinderFromCourseButton == source) {
        doNewBinderFromCourse(ureq);
    } else if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("select".equals(cmd)) {
                BinderRow row = model.getObject(se.getIndex());
                Activateable2 activateable = doOpenBinder(ureq, row);
                if (activateable != null) {
                    activateable.activate(ureq, null, null);
                }
            }
        }
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        if ("open".equals(cmd)) {
            BinderRow row = (BinderRow) link.getUserObject();
            Activateable2 activateable = doOpenBinder(ureq, row);
            if (activateable != null) {
                activateable.activate(ureq, null, null);
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 8 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project openolat by klemens.

the class DeletedBinderController method loadModel.

@Override
protected void loadModel() {
    List<BinderStatistics> binderRows = portfolioService.searchOwnedDeletedBinders(getIdentity());
    List<BinderRow> rows = new ArrayList<>(binderRows.size());
    for (BinderStatistics binderRow : binderRows) {
        rows.add(forgePortfolioRow(binderRow));
    }
    model.setObjects(rows);
    tableEl.reset();
    tableEl.reloadData();
}
Also used : BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) ArrayList(java.util.ArrayList) BinderStatistics(org.olat.modules.portfolio.model.BinderStatistics)

Example 9 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project OpenOLAT by OpenOLAT.

the class BinderListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (newBinderDropdown == source) {
        doNewBinderCallout(ureq);
    } else if (newBinderFromCourseButton == source) {
        doNewBinderFromCourse(ureq);
    } else if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("select".equals(cmd)) {
                BinderRow row = model.getObject(se.getIndex());
                Activateable2 activateable = doOpenBinder(ureq, row);
                if (activateable != null) {
                    activateable.activate(ureq, null, null);
                }
            }
        }
    } else if (source instanceof FormLink) {
        FormLink link = (FormLink) source;
        String cmd = link.getCmd();
        if ("open".equals(cmd)) {
            BinderRow row = (BinderRow) link.getUserObject();
            Activateable2 activateable = doOpenBinder(ureq, row);
            if (activateable != null) {
                activateable.activate(ureq, null, null);
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 10 with BinderRow

use of org.olat.modules.portfolio.ui.model.BinderRow in project OpenOLAT by OpenOLAT.

the class BinderListController method getComponents.

@Override
public Iterable<Component> getComponents(int row, Object rowObject) {
    BinderRow elRow = model.getObject(row);
    List<Component> components = new ArrayList<>(2);
    if (elRow.getOpenLink() != null) {
        components.add(elRow.getOpenLink().getComponent());
    }
    return components;
}
Also used : BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) ArrayList(java.util.ArrayList) Component(org.olat.core.gui.components.Component)

Aggregations

BinderRow (org.olat.modules.portfolio.ui.model.BinderRow)20 ArrayList (java.util.ArrayList)10 BinderStatistics (org.olat.modules.portfolio.model.BinderStatistics)6 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)4 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)4 VFSLeaf (org.olat.core.util.vfs.VFSLeaf)4 Component (org.olat.core.gui.components.Component)2 FlexiTableRenderEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableRenderEvent)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 ContextEntry (org.olat.core.id.context.ContextEntry)2 SynchedBinder (org.olat.modules.portfolio.model.SynchedBinder)2