Search in sources :

Example 1 with TreeNodeFlexiCellRenderer

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

the class TaxonomyTreeTableController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    newLevelButton = uifactory.addFormLink("add.taxonomy.level", formLayout, Link.BUTTON);
    deleteButton = uifactory.addFormLink("delete", formLayout, Link.BUTTON);
    mergeButton = uifactory.addFormLink("merge.taxonomy.level", formLayout, Link.BUTTON);
    typeButton = uifactory.addFormLink("type.taxonomy.level", formLayout, Link.BUTTON);
    moveButton = uifactory.addFormLink("move.taxonomy.level", formLayout, Link.BUTTON);
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, TaxonomyLevelCols.key));
    TreeNodeFlexiCellRenderer treeNodeRenderer = new TreeNodeFlexiCellRenderer();
    treeNodeRenderer.setFlatBySearchAndFilter(true);
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.displayName, treeNodeRenderer));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.identifier));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.typeIdentifier));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.numOfChildren));
    DefaultFlexiColumnModel selectColumn = new DefaultFlexiColumnModel("select", translate("select"), "select");
    selectColumn.setExportable(false);
    columnsModel.addFlexiColumnModel(selectColumn);
    DefaultFlexiColumnModel toolsColumn = new DefaultFlexiColumnModel(TaxonomyLevelCols.tools);
    toolsColumn.setExportable(false);
    columnsModel.addFlexiColumnModel(toolsColumn);
    model = new TaxonomyTreeTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
    tableEl.setSearchEnabled(true);
    tableEl.setCustomizeColumns(true);
    tableEl.setElementCssClass("o_taxonomy_level_listing");
    tableEl.setEmtpyTableMessageKey("table.taxonomy.level.empty");
    tableEl.setNumOfRowsEnabled(false);
    tableEl.setExportEnabled(true);
    tableEl.setPageSize(24);
    tableEl.setMultiSelect(true);
    tableEl.setFilters(null, getFilters(), true);
    tableEl.setRootCrumb(new TaxonomyCrumb(taxonomy.getDisplayName()));
}
Also used : TreeNodeFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TreeNodeFlexiCellRenderer) 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 2 with TreeNodeFlexiCellRenderer

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

the class TaxonomyTreeTableController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    newLevelButton = uifactory.addFormLink("add.taxonomy.level", formLayout, Link.BUTTON);
    deleteButton = uifactory.addFormLink("delete", formLayout, Link.BUTTON);
    mergeButton = uifactory.addFormLink("merge.taxonomy.level", formLayout, Link.BUTTON);
    typeButton = uifactory.addFormLink("type.taxonomy.level", formLayout, Link.BUTTON);
    moveButton = uifactory.addFormLink("move.taxonomy.level", formLayout, Link.BUTTON);
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, TaxonomyLevelCols.key));
    TreeNodeFlexiCellRenderer treeNodeRenderer = new TreeNodeFlexiCellRenderer();
    treeNodeRenderer.setFlatBySearchAndFilter(true);
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.displayName, treeNodeRenderer));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.identifier));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.typeIdentifier));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyLevelCols.numOfChildren));
    DefaultFlexiColumnModel selectColumn = new DefaultFlexiColumnModel("select", translate("select"), "select");
    selectColumn.setExportable(false);
    columnsModel.addFlexiColumnModel(selectColumn);
    DefaultFlexiColumnModel toolsColumn = new DefaultFlexiColumnModel(TaxonomyLevelCols.tools);
    toolsColumn.setExportable(false);
    columnsModel.addFlexiColumnModel(toolsColumn);
    model = new TaxonomyTreeTableModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
    tableEl.setSearchEnabled(true);
    tableEl.setCustomizeColumns(true);
    tableEl.setElementCssClass("o_taxonomy_level_listing");
    tableEl.setEmtpyTableMessageKey("table.taxonomy.level.empty");
    tableEl.setNumOfRowsEnabled(false);
    tableEl.setExportEnabled(true);
    tableEl.setPageSize(24);
    tableEl.setMultiSelect(true);
    tableEl.setFilters(null, getFilters(), true);
    tableEl.setRootCrumb(new TaxonomyCrumb(taxonomy.getDisplayName()));
}
Also used : TreeNodeFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TreeNodeFlexiCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Aggregations

DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)2 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)2 TreeNodeFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TreeNodeFlexiCellRenderer)2