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");
}
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();
}
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);
}
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");
}
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());
}
Aggregations