Package org.libreplan.business.users.entities

Examples of org.libreplan.business.users.entities.UserRole


    public RowRenderer getRolesRenderer() {
        return new RowRenderer() {
            @Override
            public void render(Row row, Object data) throws Exception {
                final UserRole role = (UserRole) data;

                row.appendChild(new Label(_(role.getDisplayName())));

                row.appendChild(Util.createRemoveButton(new EventListener() {
                    @Override
                    public void onEvent(Event event) throws Exception {
                        removeRole(role);
View Full Code Here


    public RowRenderer getAllUserRolesRenderer() {
        return new RowRenderer() {
            @Override
            public void render(Row row, Object data) throws Exception {

                final UserRole role = (UserRole) data;
                row.appendChild(new Label(role.getDisplayName()));

                final Textbox tempTextbox = new Textbox();
                Textbox textbox = Util.bind(tempTextbox, new Util.Getter<String>() {
                    @Override
                    public String get() {
                        List<String> listRoles = configurationModel.
                            getLdapConfiguration().getMapMatchingRoles().get(role.name());
                        Collections.sort(listRoles);
                        return StringUtils.join(listRoles, ";");
                    }
                }, new Util.Setter<String>() {
                    @Override
                    public void set(String value) {
                                // Created a set in order to avoid duplicates
                                Set<String> rolesLdap = new HashSet<String>(
                                        Arrays.asList(StringUtils.split(value,
                                                ";")));
                                configurationModel.getLdapConfiguration()
                                        .setConfigurationRolesLdap(role.name(),
                                                rolesLdap);
                    }
                });
                textbox.setWidth("300px");
                row.appendChild(textbox);
View Full Code Here

    public RowRenderer getRolesRenderer() {
        return new RowRenderer() {
            @Override
            public void render(Row row, Object data) throws Exception {
                final UserRole role = (UserRole) data;

                row.appendChild(new Label(_(role.getDisplayName())));

                Button removeButton = Util
                        .createRemoveButton(new EventListener() {
                    @Override
                    public void onEvent(Event event) throws Exception {
                        removeRole(role);
                    }
                });
                removeButton.setDisabled(areRolesAndProfilesDisabled()
                        || role.equals(UserRole.ROLE_BOUND_USER)
                        || isUserDefaultAdmin());
                row.appendChild(removeButton);
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.users.entities.UserRole

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.