use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project OpenOLAT by OpenOLAT.
the class WaitingGroupController method initGroupTable.
/**
* Init WaitingList-table-controller for waitinglist with addional column action=move user to participant-list.
* Show added-date attribute and sort waiting list per default by added date.
*/
@Override
protected void initGroupTable(TableController tableCtr, UserRequest ureq, boolean enableTablePreferences, boolean enableUserSelection) {
List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
// first the login name
if (isAdministrativeUser) {
// first the login name, but only if administrative user
DefaultColumnDescriptor cd0 = new DefaultColumnDescriptor("table.user.login", 0, COMMAND_VCARD, ureq.getLocale());
cd0.setIsPopUpWindowAction(true, "height=700, width=900, location=no, menubar=no, resizable=yes, status=no, scrollbars=yes, toolbar=no");
tableCtr.addColumnDescriptor(cd0);
}
if (chatEnabled) {
tableCtr.addColumnDescriptor(new CustomRenderColumnDescriptor("table.header.online", 1, COMMAND_IM, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, new OnlineIconRenderer()));
}
int visibleColId = 0;
// followed by the users fields
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = userManager.isMandatoryUserProperty(usageIdentifyer, userPropertyHandler);
ColumnDescriptor cd = userPropertyHandler.getColumnDescriptor(i + 3, COMMAND_VCARD, ureq.getLocale());
// make all user attributes clickable to open visiting card
if (cd instanceof DefaultColumnDescriptor) {
DefaultColumnDescriptor dcd = (DefaultColumnDescriptor) cd;
dcd.setIsPopUpWindowAction(true, "height=700, width=900, location=no, menubar=no, resizable=yes, status=no, scrollbars=yes, toolbar=no");
}
tableCtr.addColumnDescriptor(visible, cd);
if (visible) {
visibleColId++;
}
}
// in the end
if (enableTablePreferences) {
tableCtr.addColumnDescriptor(true, new DefaultColumnDescriptor("table.subject.addeddate", 2, COMMAND_VCARD, ureq.getLocale()));
tableCtr.setSortColumn(++visibleColId, true);
}
if (mayModifyMembers) {
tableCtr.addMultiSelectAction("action.waitinglist.move", COMMAND_MOVE_USER_WAITINGLIST);
tableCtr.addMultiSelectAction("action.remove", COMMAND_REMOVEUSER);
tableCtr.setMultiSelect(true);
}
}
use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project OpenOLAT by OpenOLAT.
the class AdvancedPropertiesController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
public void event(UserRequest ureq, Controller source, Event event) {
if (source == searchForm && event == Event.DONE_EVENT) {
String resourceTypeName = searchForm.getResourceTypeName();
String resourceTypeId = searchForm.getResourceTypeId();
Long resTypeId = null;
if (resourceTypeId != null && !resourceTypeId.equals(""))
resTypeId = Long.valueOf(resourceTypeId);
String category = searchForm.getCategory();
if (category != null && category.equals(""))
category = null;
String propertyName = searchForm.getPropertyName();
if (propertyName != null && propertyName.equals(""))
propertyName = null;
List<Property> entries = PropertyManager.getInstance().listProperties(searchForm.getIdentity(), null, resourceTypeName, resTypeId, category, propertyName);
PropertiesTableDataModel ptdm = new PropertiesTableDataModel(entries, isAdministrativeUser);
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
removeAsListenerAndDispose(tableCtr);
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
// use null as listener argument because we are using listenTo(..) from basiccontroller
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.userName", 0, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.resourceTypeName", 1, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.resourceTypeId", 2, null, getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.category", 3, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.name", 4, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.floatValue", 5, null, getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.stringValue", 6, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.longValue", 10, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.textValue", 7, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.creationdate", 8, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.lastmodified", 9, null, getLocale()));
tableCtr.setTableDataModel(ptdm);
listenTo(tableCtr);
myPanel.setContent(tableCtr.getInitialComponent());
}
}
use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project OpenOLAT by OpenOLAT.
the class ExtendedIdentitiesTableDataModel method addColumnDescriptors.
/**
* Add all column descriptors to this table that are available in the table
* model
*
* @param tableCtr
*/
public void addColumnDescriptors(TableController tableCtr, Translator trans) {
setLocale(trans.getLocale());
if (isAdministrativeUser) {
String action = actionEnabled ? COMMAND_SELECTUSER : null;
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.identity.name", colCount++, action, getLocale()));
}
UserManager um = UserManager.getInstance();
// followed by the users fields
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = um.isMandatoryUserProperty(usageIdentifyer, userPropertyHandler);
String action = null;
if (actionEnabled && i < 2) {
action = COMMAND_SELECTUSER;
}
tableCtr.addColumnDescriptor(visible, userPropertyHandler.getColumnDescriptor(colCount++, action, getLocale()));
}
// in the end the last login and creation date
tableCtr.addColumnDescriptor(false, new DefaultColumnDescriptor("table.identity.lastlogin", colCount++, null, getLocale()));
// creation date at the end, enabled by default
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.identity.creationdate", colCount++, null, getLocale()));
if (actionEnabled) {
StaticColumnDescriptor vcd = new StaticColumnDescriptor(COMMAND_VCARD, "table.header.vcard", trans.translate("table.identity.vcard"));
vcd.setIsPopUpWindowAction(true, "height=700, width=900, location=no, menubar=no, resizable=yes, status=no, scrollbars=yes, toolbar=no");
tableCtr.addColumnDescriptor(vcd);
}
}
use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project OpenOLAT by OpenOLAT.
the class UserTableDataModel method addColumnDescriptors.
/**
* Add all column descriptors to this table that are available in the table
* model
*
* @param tableCtr
* @param actionCommand command fired when the login name is clicked or NULL when no command is used
*/
public void addColumnDescriptors(TableController tableCtr, String actionCommand) {
// first column is users login name
if (isAdministrativeUser) {
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.user.login", 0, actionCommand, getLocale()));
}
// followed by the users fields
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = UserManager.getInstance().isMandatoryUserProperty(usageIdentifyer, userPropertyHandler);
tableCtr.addColumnDescriptor(visible, userPropertyHandler.getColumnDescriptor(i + 1, actionCommand, getLocale()));
}
}
use of org.olat.core.gui.components.table.DefaultColumnDescriptor in project OpenOLAT by OpenOLAT.
the class UserDeleteTableModel method addColumnDescriptors.
/**
* Add all column descriptors to this table that are available in the table model.
* The table contains userPropertyHandlers.size() columns plus a column for the
* username and one for the last login date.
*
* @param tableCtr
* @param actionCommand command fired when the login name is clicked or NULL when no command is used
*/
public void addColumnDescriptors(TableController tableCtr, String actionCommand) {
// first column is the username
if (isAdministrativeUser) {
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.user.login", 301, actionCommand, getLocale()));
}
// followed by the users fields
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
boolean visible = UserManager.getInstance().isMandatoryUserProperty(usageIdentifyer, userPropertyHandler);
tableCtr.addColumnDescriptor(visible, userPropertyHandler.getColumnDescriptor(i, null, getLocale()));
}
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.user.lastlogin", 302, actionCommand, getLocale()));
}
Aggregations