Search in sources :

Example 21 with TableGuiConfiguration

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);
}
Also used : CustomRenderColumnDescriptor(org.olat.core.gui.components.table.CustomRenderColumnDescriptor) InfoMessage(org.olat.commons.info.InfoMessage) TableController(org.olat.core.gui.components.table.TableController) TableGuiConfiguration(org.olat.core.gui.components.table.TableGuiConfiguration)

Example 22 with TableGuiConfiguration

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());
}
Also used : TableController(org.olat.core.gui.components.table.TableController) TableGuiConfiguration(org.olat.core.gui.components.table.TableGuiConfiguration) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Example 23 with TableGuiConfiguration

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);
}
Also used : TableController(org.olat.core.gui.components.table.TableController) StaticColumnDescriptor(org.olat.core.gui.components.table.StaticColumnDescriptor) TableGuiConfiguration(org.olat.core.gui.components.table.TableGuiConfiguration) Identity(org.olat.core.id.Identity)

Example 24 with TableGuiConfiguration

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;
}
Also used : TableController(org.olat.core.gui.components.table.TableController) TableGuiConfiguration(org.olat.core.gui.components.table.TableGuiConfiguration) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Example 25 with TableGuiConfiguration

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);
}
Also used : UserSessionManager(org.olat.core.util.session.UserSessionManager) UserManager(org.olat.user.UserManager) TableController(org.olat.core.gui.components.table.TableController) InstantMessagingService(org.olat.instantMessaging.InstantMessagingService) MailManager(org.olat.core.util.mail.MailManager) BaseSecurityModule(org.olat.basesecurity.BaseSecurityModule) Roles(org.olat.core.id.Roles) TableGuiConfiguration(org.olat.core.gui.components.table.TableGuiConfiguration) InstantMessagingModule(org.olat.instantMessaging.InstantMessagingModule)

Aggregations

TableController (org.olat.core.gui.components.table.TableController)60 TableGuiConfiguration (org.olat.core.gui.components.table.TableGuiConfiguration)60 DefaultColumnDescriptor (org.olat.core.gui.components.table.DefaultColumnDescriptor)38 StaticColumnDescriptor (org.olat.core.gui.components.table.StaticColumnDescriptor)14 CustomRenderColumnDescriptor (org.olat.core.gui.components.table.CustomRenderColumnDescriptor)12 BooleanColumnDescriptor (org.olat.core.gui.components.table.BooleanColumnDescriptor)10 Identity (org.olat.core.id.Identity)8 ArrayList (java.util.ArrayList)6 Date (java.util.Date)6 BaseSecurityModule (org.olat.basesecurity.BaseSecurityModule)6 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)4 Roles (org.olat.core.id.Roles)4 CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)4 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)4 RepositoryTableModel (org.olat.repository.ui.RepositoryTableModel)4 IOException (java.io.IOException)2 BigDecimal (java.math.BigDecimal)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Properties (java.util.Properties)2