use of org.olat.core.gui.components.table.TableGuiConfiguration 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.TableGuiConfiguration 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.TableGuiConfiguration 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.TableGuiConfiguration 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;
}
use of org.olat.core.gui.components.table.TableGuiConfiguration in project openolat by klemens.
the class GroupController method init.
protected void init(UserRequest ureq, boolean mayModifyMembers, boolean keepAtLeastOne, boolean enableTablePreferences, boolean enableUserSelection, boolean allowDownload, boolean mandatoryEmail, SecurityGroup aSecurityGroup) {
this.securityGroup = aSecurityGroup;
this.mayModifyMembers = mayModifyMembers;
this.keepAtLeastOne = keepAtLeastOne;
this.mandatoryEmail = mandatoryEmail;
securityManager = BaseSecurityManager.getInstance();
imModule = CoreSpringFactory.getImpl(InstantMessagingModule.class);
imService = CoreSpringFactory.getImpl(InstantMessagingService.class);
userManager = CoreSpringFactory.getImpl(UserManager.class);
sessionManager = CoreSpringFactory.getImpl(UserSessionManager.class);
mailManager = CoreSpringFactory.getImpl(MailManager.class);
Roles roles = ureq.getUserSession().getRoles();
BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
isAdministrativeUser = securityModule.isUserAllowedAdminProps(roles);
chatEnabled = imModule.isEnabled() && imModule.isPrivateEnabled();
// default group controller has no mail functionality
this.addUserMailDefaultTempl = null;
this.removeUserMailDefaultTempl = null;
groupmemberview = createVelocityContainer("index");
addUsersButton = LinkFactory.createButtonSmall("overview.addusers", groupmemberview, this);
addUsersButton.setElementCssClass("o_sel_group_import_users");
addUserButton = LinkFactory.createButtonSmall("overview.adduser", groupmemberview, this);
addUserButton.setElementCssClass("o_sel_group_add_user");
if (mayModifyMembers) {
groupmemberview.contextPut("mayadduser", Boolean.TRUE);
}
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setDownloadOffered(allowDownload);
if (enableTablePreferences) {
// save table preferences for each group seperatly
if (mayModifyMembers) {
tableConfig.setPreferencesOffered(true, "groupcontroller" + securityGroup.getKey());
} else {
// different rowcount...
tableConfig.setPreferencesOffered(true, "groupcontrollerreadonly" + securityGroup.getKey());
}
}
myTrans = userManager.getPropertyHandlerTranslator(getTranslator());
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), myTrans);
listenTo(tableCtr);
initGroupTable(tableCtr, ureq, enableTablePreferences, enableUserSelection);
// set data model
reloadData();
groupmemberview.put("subjecttable", tableCtr.getInitialComponent());
putInitialPanel(groupmemberview);
}
Aggregations