Package org.jboss.as.console.client.administration.role.form

Examples of org.jboss.as.console.client.administration.role.form.PrincipalFormItem$PrincipalSuggestion


            oracle.add(principal.getName());
        }

        final Form<RoleAssignment> form = new Form<RoleAssignment>(RoleAssignment.class);
        String title = type == GROUP ? Console.CONSTANTS.common_label_group() : Console.CONSTANTS.common_label_user();
        final PrincipalFormItem principalItem = new PrincipalFormItem(type, "principal", title);
        principalItem.setRequired(true);
        principalItem.update(principals);
        final TextBoxItem realmItem = new TextBoxItem("realm", "Realm", false);
        final ComboBoxItem includeExcludeItem = new ComboBoxItem("includeExclude",
                Console.CONSTANTS.administration_include_exclude());
        includeExcludeItem.setValueMap(
                new String[]{Console.CONSTANTS.common_label_include(), Console.CONSTANTS.common_label_exclude()});
        includeExcludeItem.setValue(Console.CONSTANTS.common_label_include());
        // TODO The rolesItem is not part of the focus chain because it's not
        // TODO recognized by org.jboss.ballroom.client.widgets.window.Focus
        final RolesFormItem rolesItem = new RolesFormItem("roles", Console.CONSTANTS.common_label_roles());
        rolesItem.setRequired(true);
        form.setFields(principalItem, realmItem, includeExcludeItem, rolesItem);

        VerticalPanel layout = new VerticalPanel();
        layout.setStyleName("window-content");
        layout.add(form.asWidget());
        rolesItem.update(roles);

        DialogueOptions options = new DialogueOptions(
                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        FormValidation validation = form.validate();
                        if (!validation.hasErrors()) {
                            RoleAssignment roleAssignment = new RoleAssignment(principalItem.getValue());
                            roleAssignment.setRealm(realmItem.getValue());
                            if (Console.CONSTANTS.common_label_include().equals(includeExcludeItem.getValue())) {
                                roleAssignment.addRoles(rolesItem.getValue());
                            } else if (Console.CONSTANTS.common_label_exclude().equals(includeExcludeItem.getValue())) {
                                roleAssignment.addExcludes(rolesItem.getValue());
View Full Code Here


            oracle.add(principal.getName());
        }

        final Form<RoleAssignment> form = new Form<RoleAssignment>(RoleAssignment.class);
        String title = type == GROUP ? "Group" : "User";
        final PrincipalFormItem principalItem = new PrincipalFormItem(type, "principal", title);
        principalItem.setRequired(true);
        principalItem.update(principals);
        final TextBoxItem realmItem = new TextBoxItem("realm", "Realm", false);
        final ComboBoxItem includeExcludeItem = new ComboBoxItem("includeExclude", "Type");
        includeExcludeItem.setValueMap(new String[]{"Include", "Exclude"});
        includeExcludeItem.setValue("Include");
        // TODO The rolesItem is not part of the focus chain because it's not
        // TODO recognized by org.jboss.ballroom.client.widgets.window.Focus
        final RolesFormItem rolesItem = new RolesFormItem("roles", "Roles");
        rolesItem.setRequired(true);
        form.setFields(principalItem, realmItem, includeExcludeItem, rolesItem);

        VerticalPanel layout = new VerticalPanel();
        layout.setStyleName("window-content");
        layout.add(new RoleAssignmentHelpPanel(title).asWidget());
        layout.add(form.asWidget());
        rolesItem.update(roles);

        DialogueOptions options = new DialogueOptions(
                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        FormValidation validation = form.validate();
                        if (!validation.hasErrors()) {
                            // if a realm was specified, include the realm in the principals id.
                            final String realm = realmItem.getValue();
                            Principal principal = principalItem.getValue();
                            if (realm != null && realm.length() != 0) {
                                principal = new Principal(principal.getId() + "@" + realm, principal.getName(),
                                        principal.getType());
                            }
                            RoleAssignment roleAssignment = new RoleAssignment(principal);
View Full Code Here

            oracle.add(principal.getName());
        }

        final Form<RoleAssignment> form = new Form<RoleAssignment>(RoleAssignment.class);
        String title = type == GROUP ? "Group" : "User";
        final PrincipalFormItem principalItem = new PrincipalFormItem(type, "principal", title);
        principalItem.setRequired(true);
        principalItem.update(principals);
        final TextBoxItem realmItem = new TextBoxItem("realm", "Realm", false);
        final ComboBoxItem includeExcludeItem = new ComboBoxItem("includeExclude", "Type");
        includeExcludeItem.setValueMap(new String[]{"Include", "Exclude"});
        includeExcludeItem.setValue("Include");
        // TODO The rolesItem is not part of the focus chain because it's not
        // TODO recognized by org.jboss.ballroom.client.widgets.window.Focus
        final RolesFormItem rolesItem = new RolesFormItem("roles", "Roles");
        rolesItem.setRequired(true);
        form.setFields(principalItem, realmItem, includeExcludeItem, rolesItem);

        VerticalPanel layout = new VerticalPanel();
        layout.setStyleName("window-content");
        layout.add(new RoleAssignmentHelpPanel(title).asWidget());
        layout.add(form.asWidget());
        rolesItem.update(roles);

        DialogueOptions options = new DialogueOptions(
                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        FormValidation validation = form.validate();
                        if (!validation.hasErrors()) {
                            // if a realm was specified, include the realm in the principals id.
                            final String realm = realmItem.getValue();
                            Principal principal = principalItem.getValue();
                            if (realm != null && realm.length() != 0) {
                                principal = new Principal(principal.getId() + "@" + realm, principal.getName(),
                                        principal.getType());
                            }
                            RoleAssignment roleAssignment = new RoleAssignment(principal);
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.administration.role.form.PrincipalFormItem$PrincipalSuggestion

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.