use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class BusinessGroupMainRunController method doShowResources.
private void doShowResources(UserRequest ureq) {
// always refresh data model, maybe it has changed
RepositoryTableModel repoTableModel = new RepositoryTableModel(getLocale());
List<RepositoryEntry> repoTableModelEntries = businessGroupService.findRepositoryEntries(Collections.singletonList(businessGroup), 0, -1);
repoTableModel.setObjects(repoTableModelEntries);
// init table controller only once
if (resourcesCtr == null) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("resources.noresources"));
// removeAsListenerAndDispose(resourcesCtr);
resourcesCtr = new TableController(tableConfig, ureq, getWindowControl(), resourceTrans);
listenTo(resourcesCtr);
resourcesVC = createVelocityContainer("resources");
repoTableModel.addColumnDescriptors(resourcesCtr, true, false, false, false);
resourcesVC.put("resources", resourcesCtr.getInitialComponent());
}
// add table model to table
resourcesCtr.setTableDataModel(repoTableModel);
mainPanel.setContent(resourcesVC);
addToHistory(ureq, ORES_TOOLRESOURCES, null);
}
use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class InfoPeekViewController method init.
private void init(UserRequest ureq) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("peekview.noInfos"));
tableConfig.setDisplayTableHeader(false);
tableConfig.setCustomCssClass("o_portlet_table");
tableConfig.setDisplayRowCount(false);
tableConfig.setPageingEnabled(false);
tableConfig.setDownloadOffered(false);
tableConfig.setSortingEnabled(false);
removeAsListenerAndDispose(tableController);
tableController = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
tableController.addColumnDescriptor(new CustomRenderColumnDescriptor("peekview.title", 0, null, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, new InfoNodeRenderer()));
String resSubPath = courseNode.getIdent();
List<InfoMessage> infos = infoService.loadInfoMessageByResource(ores, resSubPath, null, null, null, 0, 5);
InfosTableModel model = new InfosTableModel(infos);
tableController.setTableDataModel(model);
listenTo(tableController);
}
use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class MembersPeekViewController method initForm.
private void initForm(UserRequest ureq) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setDisplayTableHeader(false);
tableConfig.setCustomCssClass("o_portlet_table table-condensed");
tableConfig.setDisplayRowCount(false);
tableConfig.setPageingEnabled(false);
tableConfig.setDownloadOffered(false);
tableConfig.setSortingEnabled(false);
removeAsListenerAndDispose(tableController);
tableController = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
listenTo(tableController);
tableController.addColumnDescriptor(new DefaultColumnDescriptor("members.type", 0, null, ureq.getLocale()));
tableController.addColumnDescriptor(new DefaultColumnDescriptor("members.count", 1, null, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_LEFT));
tableController.setTableDataModel(new DefaultTableDataModel<Row>(entries) {
@Override
public int getColumnCount() {
return 2;
}
@Override
public Object getValueAt(int row, int col) {
Row r = entries.get(row);
if (col == 0) {
return r.col1;
}
if (col == 1) {
return r.col2;
}
return null;
}
});
putInitialPanel(tableController.getInitialComponent());
}
use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class ReadyToDeleteController method initializeTableController.
private void initializeTableController(UserRequest ureq) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("error.no.user.found"));
tableConfig.setShowAllLinkEnabled(false);
removeAsListenerAndDispose(tableCtr);
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), this.propertyHandlerTranslator);
listenTo(tableCtr);
List<Identity> l = UserDeletionManager.getInstance().getIdentitiesInDeletionProcess(UserDeletionManager.getInstance().getDeleteEmailDuration());
tdm = new UserDeleteTableModel(l, getLocale(), isAdministrativeUser);
tdm.addColumnDescriptors(tableCtr, null, "table.identity.deleteEmail");
tableCtr.addColumnDescriptor(new StaticColumnDescriptor(ACTION_SINGLESELECT_CHOOSE, "table.header.action", translate("action.activate")));
tableCtr.addMultiSelectAction("action.ready.to.delete", ACTION_MULTISELECT_CHOOSE);
tableCtr.setMultiSelect(true);
tableCtr.setTableDataModel(tdm);
}
use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class DENManager method createManageDatesTable.
/**
* Create the table for the manage dates view
* @param ureq
* @param wControl
* @param trans
* @param listener
* @param tableData DENEditTableDataModel
* @return TableController
*/
protected TableController createManageDatesTable(UserRequest ureq, WindowControl wControl, Translator trans, DENEditTableDataModel tableData) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setResultsPerPage(15);
tableConfig.setShowAllLinkEnabled(true);
TableController tableCntrl = new TableController(tableConfig, ureq, wControl, trans);
tableCntrl.addColumnDescriptor(new StrongColumnDescriptor("dates.table.date", 0, null, ureq.getLocale()));
tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.begin", 1, null, ureq.getLocale()));
tableCntrl.addColumnDescriptor(new StrongColumnDescriptor("dates.table.location", 3, null, ureq.getLocale()));
tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.duration", 2, null, ureq.getLocale()));
tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.comment", 4, null, ureq.getLocale()));
tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.participants.num", 5, null, ureq.getLocale()));
tableCntrl.addMultiSelectAction("dates.table.edit.change", DENEditTableDataModel.CHANGE_ACTION);
tableCntrl.addMultiSelectAction("dates.table.edit.delete", DENEditTableDataModel.DELETE_ACTION);
tableCntrl.setMultiSelect(true);
tableCntrl.setTableDataModel(tableData);
// begin + multi select column
tableCntrl.setSortColumn(2, true);
return tableCntrl;
}
Aggregations