Search in sources :

Example 46 with FlexiTableColumnModel

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

the class SubmitDocumentsController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    if (config.getBooleanSafe(GTACourseNode.GTASK_EXTERNAL_EDITOR)) {
        uploadDocButton = uifactory.addFormLink("upload.document", formLayout, Link.BUTTON);
        uploadDocButton.setIconLeftCSS("o_icon o_icon_upload");
        uploadDocButton.setElementCssClass("o_sel_course_gta_submit_file");
        uploadDocButton.setVisible(!readOnly);
    }
    if (config.getBooleanSafe(GTACourseNode.GTASK_EMBBEDED_EDITOR)) {
        createDocButton = uifactory.addFormLink("open.editor", formLayout, Link.BUTTON);
        createDocButton.setIconLeftCSS("o_icon o_icon_edit");
        createDocButton.setElementCssClass("o_sel_course_gta_create_doc");
        createDocButton.setI18nKey(docI18nKey + ".open.editor");
        createDocButton.setVisible(!readOnly);
    }
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(docI18nKey, DocCols.document.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(DocCols.date.i18nKey(), DocCols.date.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(DocCols.uploadedBy.i18nKey(), DocCols.uploadedBy.ordinal()));
    if (!readOnly) {
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("edit", DocCols.edit.ordinal(), "edit", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("edit"), "edit"), new StaticFlexiCellRenderer(translate("replace"), "edit"))));
        columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", translate("delete"), "delete"));
    }
    model = new DocumentTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", model, getTranslator(), formLayout);
    formLayout.add("table", tableEl);
    // configure table to be as slim as possible
    tableEl.setCustomizeColumns(false);
    tableEl.setNumOfRowsEnabled(false);
    tableEl.setElementCssClass("o_table_no_margin");
}
Also used : StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 47 with FlexiTableColumnModel

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

the class VideoAdminTranscodingController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("manage.transcodings.title");
    setFormDescription("manage.transcodings.description");
    setFormContextHelp("Portfolio template: Administration and editing#configuration");
    FlexiTableColumnModel transcodingModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    transcodingModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TranscodingCols.resolutions));
    transcodingModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TranscodingCols.sumVideos));
    transcodingModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TranscodingCols.numberTranscodings));
    transcodingModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TranscodingCols.failedTranscodings));
    transcodingModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TranscodingCols.missingTranscodings));
    transcodingModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TranscodingCols.transcode, "quality.transcode", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("quality.transcode"), "quality.transcode", "", "o_icon o_icon_refresh o_icon-fw"), null)));
    transcodingModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TranscodingCols.delete, "quality.delete", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("quality.delete"), "quality.delete", "", "o_icon o_icon_delete_item o_icon-fw"), null)));
    tableModel = new TranscodingTableModel(transcodingModel, getTranslator());
    transcodingTable = uifactory.addTableElement(getWindowControl(), "table", tableModel, getTranslator(), formLayout);
    transcodingTable.setCustomizeColumns(false);
    transcodingTable.setNumOfRowsEnabled(false);
    loadTable();
}
Also used : StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 48 with FlexiTableColumnModel

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

the class VideoTrackEditController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FormLayoutContainer generalCont = FormLayoutContainer.createVerticalFormLayout("general", getTranslator());
    generalCont.setFormTitle(translate("tab.video.trackConfig"));
    generalCont.setRootForm(mainForm);
    generalCont.setFormContextHelp("Learning resource: Video#_video_subtitle");
    formLayout.add(generalCont);
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, TrackTableCols.file.i18nKey(), TrackTableCols.file.ordinal(), true, TrackTableCols.file.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TrackTableCols.language.i18nKey(), TrackTableCols.language.ordinal(), true, TrackTableCols.language.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, TrackTableCols.delete.i18nKey(), TrackTableCols.delete.ordinal(), false, TrackTableCols.delete.name()));
    tableModel = new VideoTracksTableModel(columnsModel, getLocale());
    tableEl = uifactory.addTableElement(getWindowControl(), "tracks", tableModel, getTranslator(), generalCont);
    tableEl.setCustomizeColumns(false);
    Map<String, VFSLeaf> tracks = videoManager.getAllTracks(videoResource);
    List<TrackTableRow> rows = new ArrayList<>(tracks.size());
    for (Map.Entry<String, VFSLeaf> entry : tracks.entrySet()) {
        rows.add(forgeRow(entry.getKey(), entry.getValue()));
    }
    tableModel.setObjects(rows);
    tableEl.setEmtpyTableMessageKey("track.notrack");
    addButton = uifactory.addFormLink("add.track", generalCont, Link.BUTTON);
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) ArrayList(java.util.ArrayList) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) Map(java.util.Map) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 49 with FlexiTableColumnModel

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

the class IdentityCompetencesController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    addManageButton = uifactory.addFormLink("add.competence.manage", formLayout, Link.BUTTON);
    addTeachButton = uifactory.addFormLink("add.competence.teach", formLayout, Link.BUTTON);
    addHaveButton = uifactory.addFormLink("add.competence.have", formLayout, Link.BUTTON);
    addTargetButton = uifactory.addFormLink("add.competence.target", formLayout, Link.BUTTON);
    // table
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdCompetenceCols.key));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdCompetenceCols.taxonomyIdentifier));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdCompetenceCols.taxonomyDisplayName));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdCompetenceCols.taxonomyExternalId));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdCompetenceCols.taxonomyLevelIdentifier));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdCompetenceCols.taxonomyLevelDisplayName));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, IdCompetenceCols.taxonomyLevelExternalId));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdCompetenceCols.taxonomyLevelType));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdCompetenceCols.type, new TaxonomyCompetenceTypeRenderer(getTranslator())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdCompetenceCols.expiration, new DateFlexiCellRenderer(getLocale())));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("remove", IdCompetenceCols.remove.ordinal(), "remove", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("remove"), "remove"), null)));
    tableModel = new IdentityCompetenceTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 20, false, getTranslator(), formLayout);
    tableEl.setCustomizeColumns(true);
    tableEl.setAndLoadPersistedPreferences(ureq, "tax-identity-competences");
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) TaxonomyCompetenceTypeRenderer(org.olat.modules.taxonomy.ui.component.TaxonomyCompetenceTypeRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 50 with FlexiTableColumnModel

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

the class TaxonomyListAdminController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    createTaxonomyButton = uifactory.addFormLink("create.taxonomy", formLayout, Link.BUTTON);
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, TaxonomyCols.key, "select"));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyCols.displayName, "select"));
    model = new TaxonomyListDataModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
    tableEl.setAvailableRendererTypes(FlexiTableRendererType.custom);
    tableEl.setRendererType(FlexiTableRendererType.custom);
    tableEl.setSearchEnabled(false);
    tableEl.setCustomizeColumns(false);
    tableEl.setElementCssClass("o_taxonomy_listing");
    tableEl.setEmtpyTableMessageKey("table.taxonomy.empty");
    tableEl.setNumOfRowsEnabled(false);
    tableEl.setPageSize(24);
    VelocityContainer row = createVelocityContainer("taxonomy_row");
    // sets its own DOM id in velocity container
    row.setDomReplacementWrapperRequired(false);
    tableEl.setRowRenderer(row, this);
    tableEl.setCssDelegate(new TaxonomyCssDelegate());
}
Also used : FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Aggregations

FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)266 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)254 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)118 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)72 BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)70 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)70 TextFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer)60 ArrayList (java.util.ArrayList)48 FlexiTableSortOptions (org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions)46 SortKey (org.olat.core.commons.persistence.SortKey)44 FlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiColumnModel)36 DateFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer)26 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)22 FlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiCellRenderer)22 PassedCellRenderer (org.olat.course.assessment.bulk.PassedCellRenderer)20 CSSIconFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.CSSIconFlexiCellRenderer)18 ScoreCellRenderer (org.olat.modules.assessment.ui.ScoreCellRenderer)18 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)14 FlexiTableElement (org.olat.core.gui.components.form.flexible.elements.FlexiTableElement)12 Translator (org.olat.core.gui.translator.Translator)12