plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleMappingWizard.java [80:130]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public void createControl(Composite parent) {
            Composite composite = createComposite(parent);
            createLabel(composite, CommonMessages.type);
            type = createCombo(composite, ROLE_MAPPING_TYPES, false);
            nameLabel = createLabel(composite, CommonMessages.name);
            name = createTextField(composite, "");
            name.setFocus();
            clazzLabel = createLabel(composite, CommonMessages.className);
            clazz = createCombo(composite, PRINCIPAL_CLASSES, true);
            clazz.select(0);
            domainNameLabel = createLabel(composite, CommonMessages.editorDomainName);
            domainName = createTextField(composite, "");
            realmNameLabel = createLabel(composite, CommonMessages.editorRealmName);
            realmName = createCombo(composite, getSecurityRealms(), true);

            type.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent arg0) {
                    toggleFields();
                }
            });
            if (eObject == null) {
                type.select(DISTINGUISHED_NAME);
            }
            else {
                // set the fields to the values in eObject and select the correct type
                if (DistinguishedName.class.isInstance(eObject)) {
                    name.setText(((DistinguishedName)eObject).getName());
                    type.select(DISTINGUISHED_NAME);
                }
                else {
                    name.setText(((Principal)eObject).getName());
                    clazz.setText(((Principal)eObject).getClazz());
                    if (LoginDomainPrincipal.class.isInstance(eObject)) {
                        domainName.setText(((LoginDomainPrincipal)eObject).getDomainName());
                        if (RealmPrincipal.class.isInstance(eObject)) {
                            realmName.setText(((RealmPrincipal)eObject).getRealmName());
                            type.select(REALM_PRINCIPAL);
                        }
                        else {
                            type.select(LOGIN_DOMAIN_PRINCIPAL);
                        }
                    }
                    else {
                        type.select(PRINCIPAL);
                    }
                }
                type.setEnabled(false);
            }
            toggleFields();
            setControl(composite);
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/SecurityRoleMappingWizard.java [78:128]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public void createControl(Composite parent) {
            Composite composite = createComposite(parent);
            createLabel(composite, CommonMessages.type);
            type = createCombo(composite, ROLE_MAPPING_TYPES, false);
            nameLabel = createLabel(composite, CommonMessages.name);
            name = createTextField(composite, "");
            name.setFocus();
            clazzLabel = createLabel(composite, CommonMessages.className);
            clazz = createCombo(composite, PRINCIPAL_CLASSES, true);
            clazz.select(0);
            domainNameLabel = createLabel(composite, CommonMessages.editorDomainName);
            domainName = createTextField(composite, "");
            realmNameLabel = createLabel(composite, CommonMessages.editorRealmName);
            realmName = createCombo(composite, getSecurityRealms(), true);

            type.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent arg0) {
                    toggleFields();
                }
            });
            if (eObject == null) {
                type.select(DISTINGUISHED_NAME);
            }
            else {
                // set the fields to the values in eObject and select the correct type
                if (DistinguishedName.class.isInstance(eObject)) {
                    name.setText(((DistinguishedName)eObject).getName());
                    type.select(DISTINGUISHED_NAME);
                }
                else {
                    name.setText(((Principal)eObject).getName());
                    clazz.setText(((Principal)eObject).getClazz());
                    if (LoginDomainPrincipal.class.isInstance(eObject)) {
                        domainName.setText(((LoginDomainPrincipal)eObject).getDomainName());
                        if (RealmPrincipal.class.isInstance(eObject)) {
                            realmName.setText(((RealmPrincipal)eObject).getRealmName());
                            type.select(REALM_PRINCIPAL);
                        }
                        else {
                            type.select(LOGIN_DOMAIN_PRINCIPAL);
                        }
                    }
                    else {
                        type.select(PRINCIPAL);
                    }
                }
                type.setEnabled(false);
            }
            toggleFields();
            setControl(composite);
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



