Search in sources :

Example 16 with BinderRow

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

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)

Example 17 with BinderRow

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

the class BinderListController method forgePortfolioRow.

protected BinderRow forgePortfolioRow(BinderStatistics binderRow) {
    String openLinkId = "open_" + (++counter);
    FormLink openLink = uifactory.addFormLink(openLinkId, "open", "open", null, flc, Link.LINK);
    openLink.setIconRightCSS("o_icon o_icon_start");
    VFSLeaf image = portfolioService.getPosterImageLeaf(binderRow);
    BinderRow row = new BinderRow(binderRow, image, openLink);
    openLink.setUserObject(row);
    return row;
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 18 with BinderRow

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

the class PortfolioHomeController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (myBindersLink == source) {
        BinderListController bindersCtrl = doOpenMyBinders(ureq);
        if (!portfolioModule.isLearnerCanCreateBinders() && bindersCtrl.getNumOfBinders() == 1) {
            BinderRow row = bindersCtrl.getFirstBinder();
            OLATResourceable resource = OresHelper.createOLATResourceableInstance(Binder.class, row.getKey());
            List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromString(resource);
            bindersCtrl.activate(ureq, entries, null);
        }
    } else if (myEntriesLink == source) {
        doOpenMyPages(ureq);
    } else if (mySharedItemsLink == source) {
        doOpenMySharedItems(ureq);
    } else if (sharedItemsLink == source) {
        doOpenSharedWithMe(ureq).activate(ureq, null, null);
    } else if (mediaCenterLink == source) {
        doOpenMediaCenter(ureq);
    } else if (editLastEntryLink == source) {
        doOpenLastEntry(ureq);
    } else if (createNewEntryLink == source) {
        doNewEntry(ureq);
    } else if (showHelpLink == source) {
    } else if (goToTrashLink == source) {
        doDeletedPages(ureq);
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 19 with BinderRow

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

the class DeletedBinderController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof FlexiTableRenderEvent) {
            FlexiTableRenderEvent se = (FlexiTableRenderEvent) event;
            deleteButton.setVisible(se.getRendererType() == FlexiTableRendererType.classic && model.getRowCount() > 0);
            tableEl.setSelectAllEnable(tableEl.getRendererType() == FlexiTableRendererType.classic);
        } else if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("restore".equals(cmd)) {
                BinderRow row = model.getObject(se.getIndex());
                doConfirmRestoreBinder(ureq, row);
            }
        }
    } else if (deleteButton == source) {
        doConfirmDelete(ureq);
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FlexiTableRenderEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableRenderEvent)

Example 20 with BinderRow

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

the class DeletedBinderController method doConfirmDelete.

private void doConfirmDelete(UserRequest ureq) {
    if (deleteBinderCtrl != null)
        return;
    List<BinderRow> rows = getSelectedRows();
    if (rows.isEmpty()) {
        showWarning("binder.atleastone");
    } else {
        List<BinderStatistics> stats = new ArrayList<>(rows.size());
        for (BinderRow row : rows) {
            stats.add(row.getStatistics());
        }
        deleteBinderCtrl = new ConfirmDeleteBinderController(ureq, getWindowControl(), stats);
        listenTo(deleteBinderCtrl);
        String title = translate("delete.binder");
        cmc = new CloseableModalController(getWindowControl(), null, deleteBinderCtrl.getInitialComponent(), true, title, true);
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : BinderRow(org.olat.modules.portfolio.ui.model.BinderRow) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ArrayList(java.util.ArrayList) BinderStatistics(org.olat.modules.portfolio.model.BinderStatistics)

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