plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRealmWizard.java [854:1115]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	    for (int i = 0; i < dbPool.size(); i++) {
		String str = dbPool.get(i).getName();
		combo.add(str);
	    }
	}

	public boolean canFlipToNextPage() {
	    // no next page for this path through the wizard
	    return false;
	}

	public IWizardPage getNextPage() {
	    return null;
	}
    }

    public class LDAPConnectionPage extends WizardPage {
	Text[] text = new Text[4];
	Combo[] combo = new Combo[3];

    protected LDAPConnectionPage(String pageName) {
        super(pageName);
        setTitle(Messages.ldapRealm);
        setDescription(Messages.ldapRealmDesc);
    }

	public void createControl(Composite parent) {
	    Composite composite = new Composite(parent, SWT.NULL);
	    GridLayout layout = new GridLayout();
	    layout.numColumns = 2;
	    composite.setLayout(layout);
	    GridData data = new GridData();
	    data.verticalAlignment = GridData.FILL;
	    data.horizontalAlignment = GridData.FILL;
	    data.widthHint = 300;
	    composite.setLayoutData(data);

        Group connectionGroup = new Group(composite, SWT.NULL);
        connectionGroup.setText(Messages.ldapServerConnection);
        GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 4;
        GridData data1 = new GridData();
        data1.horizontalAlignment = GridData.FILL;
        data1.grabExcessHorizontalSpace = true;
        data1.horizontalSpan = 2;
        connectionGroup.setLayout(gridLayout);
        connectionGroup.setLayoutData(data1);

        createLabel(connectionGroup, Messages.initContextFactory, 1);
        combo[0] = new Combo(connectionGroup, SWT.NONE);
        combo[0].setLayoutData(new GridData(GridData.FILL, GridData.FILL,
            true, false, 3, 1));
        combo[0].add("com.sun.jndi.ldap.LdapCtxFactory");
        
        createLabel(connectionGroup, Messages.connectionUrl, 1);
        combo[1] = new Combo(connectionGroup, SWT.NONE);
        combo[1].setLayoutData(new GridData(GridData.FILL, GridData.FILL,
            true, false, 3, 1));
        combo[1].add("ldap://localhost:1389");
        combo[1].add("ldap://localhost:389");
        createLabel(connectionGroup, Messages.connectUsername, 1);
        text[0] = createText(connectionGroup, 3);
        text[0].setText("system");
        createLabel(connectionGroup, Messages.conncetPwd, 1);
        text[1] = createText(connectionGroup, 3);
        text[1].setEchoChar('*');
        text[1].setText("manager");
        createLabel(connectionGroup, Messages.confirmPassword, 1);
        text[2] = createText(connectionGroup, 3);
        text[2].setEchoChar('*');
        text[2].setText("manager");
        createLabel(connectionGroup, Messages.connectProtocol, 1);
        text[3] = createText(connectionGroup, 1);
        createLabel(connectionGroup, Messages.authentication, 1);
        combo[2] = new Combo(connectionGroup, SWT.NONE);
        combo[2].setLayoutData(new GridData(GridData.FILL, GridData.FILL,
            true, false, 1, 1));
        combo[2].add(Messages.none);
        combo[2].add(Messages.simple);
        combo[2].add(Messages.strong);
        combo[2].select(1);

	    if (eObject != null) {
		Gbean gbean = (Gbean) ((JAXBElement) eObject).getValue();
		if (getOptionValue(gbean, "initialContextFactory") != null) {
		    this.combo[0].setText(getOptionValue(gbean,
			    "initialContextFactory"));
		}
		if (getOptionValue(gbean, "connectionURL") != null) {
		    this.combo[1]
			    .setText(getOptionValue(gbean, "connectionURL"));
		}
		if (getOptionValue(gbean, "connectionUsername") != null) {
		    this.text[0].setText(getOptionValue(gbean,
			    "connectionUsername"));
		}
		if (getOptionValue(gbean, "connectionPassword") != null) {
		    this.text[1].setText(getOptionValue(gbean,
			    "connectionPassword"));
		    this.text[2].setText(getOptionValue(gbean,
			    "connectionPassword"));
		}
		if (getOptionValue(gbean, "connectionProtocol") != null) {
		    this.text[3].setText(getOptionValue(gbean,
			    "connectionProtocol"));
		}
		if (getOptionValue(gbean, "authentication") != null) {
		    this.combo[2].setText(getOptionValue(gbean,
			    "authentication"));
		}

	    }

	    setControl(composite);
	}

	public IWizardPage getNextPage() {
	    return this.getWizard().getPage("LDAPSearchPage");
	}

    }

    public class LDAPSearchPage extends WizardPage {
	Text[] text = new Text[6];
	Button userSearchSubtree, roleSearchSubtree;

    protected LDAPSearchPage(String pageName) {
        super(pageName);
        setTitle(Messages.ldapRealmSearchConfig);
        setDescription(Messages.editLdapRealmSearch);
    }

	public void createControl(Composite parent) {
	    Composite composite = new Composite(parent, SWT.NULL);
	    GridLayout layout = new GridLayout();
	    layout.numColumns = 2;
	    composite.setLayout(layout);
	    GridData data = new GridData();
	    data.verticalAlignment = GridData.FILL;
	    data.horizontalAlignment = GridData.FILL;
	    data.widthHint = 300;
	    composite.setLayoutData(data);

        Group userGroup = new Group(composite, SWT.NULL);
        userGroup.setText(Messages.userSearchConfig);
        GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 4;
        GridData data1 = new GridData();
        data1.horizontalAlignment = GridData.FILL;
        data1.grabExcessHorizontalSpace = true;
        data1.horizontalSpan = 2;
        userGroup.setLayout(gridLayout);
        userGroup.setLayoutData(data1);

        createLabel(userGroup, Messages.userBase, 1);
        text[0] = createText(userGroup, 3);
        createLabel(userGroup, Messages.userSearchMachting, 1);
        text[1] = createText(userGroup, 3);
        userSearchSubtree = new Button(userGroup, SWT.CHECK);
        userSearchSubtree.setText(Messages.userSearchSubtree);
        userSearchSubtree.setLayoutData(new GridData(GridData.FILL,
            GridData.FILL, true, false, 4, 1));
        userSearchSubtree.setSelection(true);

        Group roleGroup = new Group(composite, SWT.NULL);
        roleGroup.setText(Messages.roleSearchConfig);
        gridLayout = new GridLayout();
        gridLayout.numColumns = 4;
        data1 = new GridData();
        data1.horizontalAlignment = GridData.FILL;
        data1.grabExcessHorizontalSpace = true;
        data1.horizontalSpan = 2;
        roleGroup.setLayout(gridLayout);
        roleGroup.setLayoutData(data1);
        createLabel(roleGroup, Messages.roleBase, 1);
        text[2] = createText(roleGroup, 3);
        createLabel(roleGroup, Messages.roleName, 1);
        text[3] = createText(roleGroup, 3);
        createLabel(roleGroup, Messages.roleUserSearchStr, 1);
        text[4] = createText(roleGroup, 3);
        createLabel(roleGroup, Messages.userRoleSearchStr, 1);
        text[5] = createText(roleGroup, 3);
        roleSearchSubtree = new Button(roleGroup, SWT.CHECK);
        roleSearchSubtree.setText(Messages.roleSearchSubtree);
        roleSearchSubtree.setLayoutData(new GridData(GridData.FILL,
            GridData.FILL, true, false, 4, 1));
        roleSearchSubtree.setSelection(true);

	    if (eObject != null) {
		Gbean gbean = (Gbean) ((JAXBElement<?>) eObject).getValue();
		if (getOptionValue(gbean, "userBase") != null) {
		    text[0].setText(getOptionValue(gbean, "userBase"));
		}
		if (getOptionValue(gbean, "userSearchMatching") != null) {
		    text[1]
			    .setText(getOptionValue(gbean, "userSearchMatching"));
		}
		if (getOptionValue(gbean, "userSearchSubtree") != null) {
		    this.userSearchSubtree.setSelection(Boolean
			    .parseBoolean(getOptionValue(gbean,
				    "userSearchSubtree")));
		}
		if (getOptionValue(gbean, "roleBase") != null) {
		    text[2].setText(getOptionValue(gbean, "roleBase"));
		}
		if (getOptionValue(gbean, "roleName") != null) {
		    text[3].setText(getOptionValue(gbean, "roleName"));
		}
		if (getOptionValue(gbean, "roleSearchMatching") != null) {
		    text[4]
			    .setText(getOptionValue(gbean, "roleSearchMatching"));
		}
		if (getOptionValue(gbean, "userRoleName") != null) {
		    text[5].setText(getOptionValue(gbean, "userRoleName"));
		}
		if (getOptionValue(gbean, "roleSearchSubtree") != null) {
		    this.userSearchSubtree.setSelection(Boolean
			    .parseBoolean(getOptionValue(gbean,
				    "roleSearchSubtree")));
		}
	    }

	    setControl(composite);
	}

	public boolean canFlipToNextPage() {
	    // no next page for this path through the wizard
	    return false;
	}

	public IWizardPage getNextPage() {
	    return null;
	}

    }

    private String getAttributeValue(Gbean gbean, String attributeName) {
	try {
	    List<JAXBElement<?>> elelist = gbean
		    .getAttributeOrXmlAttributeOrReference();
	    for (JAXBElement<?> ele : elelist) {
		if (Attribute.class.isInstance(ele.getValue())
			&& ((Attribute) ele.getValue()).getName().equals(
				attributeName)) {
		    return ((Attribute) ele.getValue()).getValue();
		}
	    }
	} catch (NullPointerException e) {
	    // ignore
	}
	return null;
    }

    private String getLoginModuleClass(Gbean gbean) {

	try {
	    List<JAXBElement<?>> elelist = gbean
		    .getAttributeOrXmlAttributeOrReference();
	    for (JAXBElement<?> ele : elelist) {
		if (XmlAttributeType.class.isInstance(ele.getValue())
			&& ((XmlAttributeType) ele.getValue()).getName()
				.equals("LoginModuleConfiguration")) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/SecurityRealmWizard.java [855:1116]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        for (int i = 0; i < dbPool.size(); i++) {
        String str = dbPool.get(i).getName();
        combo.add(str);
        }
    }

    public boolean canFlipToNextPage() {
        // no next page for this path through the wizard
        return false;
    }

    public IWizardPage getNextPage() {
        return null;
    }
    }

    public class LDAPConnectionPage extends WizardPage {
    Text[] text = new Text[4];
    Combo[] combo = new Combo[3];

    protected LDAPConnectionPage(String pageName) {
        super(pageName);
        setTitle(Messages.ldapRealm);
        setDescription(Messages.ldapRealmDesc);
    }

    public void createControl(Composite parent) {
        Composite composite = new Composite(parent, SWT.NULL);
        GridLayout layout = new GridLayout();
        layout.numColumns = 2;
        composite.setLayout(layout);
        GridData data = new GridData();
        data.verticalAlignment = GridData.FILL;
        data.horizontalAlignment = GridData.FILL;
        data.widthHint = 300;
        composite.setLayoutData(data);

        Group connectionGroup = new Group(composite, SWT.NULL);
        connectionGroup.setText(Messages.ldapServerConnection);
        GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 4;
        GridData data1 = new GridData();
        data1.horizontalAlignment = GridData.FILL;
        data1.grabExcessHorizontalSpace = true;
        data1.horizontalSpan = 2;
        connectionGroup.setLayout(gridLayout);
        connectionGroup.setLayoutData(data1);

        createLabel(connectionGroup, Messages.initContextFactory, 1);
        combo[0] = new Combo(connectionGroup, SWT.NONE);
        combo[0].setLayoutData(new GridData(GridData.FILL, GridData.FILL,
            true, false, 3, 1));
        combo[0].add("com.sun.jndi.ldap.LdapCtxFactory");
        
        createLabel(connectionGroup, Messages.connectionUrl, 1);
        combo[1] = new Combo(connectionGroup, SWT.NONE);
        combo[1].setLayoutData(new GridData(GridData.FILL, GridData.FILL,
            true, false, 3, 1));
        combo[1].add("ldap://localhost:1389");
        combo[1].add("ldap://localhost:389");
        createLabel(connectionGroup, Messages.connectUsername, 1);
        text[0] = createText(connectionGroup, 3);
        text[0].setText("system");
        createLabel(connectionGroup, Messages.conncetPwd, 1);
        text[1] = createText(connectionGroup, 3);
        text[1].setEchoChar('*');
        text[1].setText("manager");
        createLabel(connectionGroup, Messages.confirmPassword, 1);
        text[2] = createText(connectionGroup, 3);
        text[2].setEchoChar('*');
        text[2].setText("manager");
        createLabel(connectionGroup, Messages.connectProtocol, 1);
        text[3] = createText(connectionGroup, 1);
        createLabel(connectionGroup, Messages.authentication, 1);
        combo[2] = new Combo(connectionGroup, SWT.NONE);
        combo[2].setLayoutData(new GridData(GridData.FILL, GridData.FILL,
            true, false, 1, 1));
        combo[2].add(Messages.none);
        combo[2].add(Messages.simple);
        combo[2].add(Messages.strong);
        combo[2].select(1);

        if (eObject != null) {
        Gbean gbean = (Gbean) ((JAXBElement) eObject).getValue();
        if (getOptionValue(gbean, "initialContextFactory") != null) {
            this.combo[0].setText(getOptionValue(gbean,
                "initialContextFactory"));
        }
        if (getOptionValue(gbean, "connectionURL") != null) {
            this.combo[1]
                .setText(getOptionValue(gbean, "connectionURL"));
        }
        if (getOptionValue(gbean, "connectionUsername") != null) {
            this.text[0].setText(getOptionValue(gbean,
                "connectionUsername"));
        }
        if (getOptionValue(gbean, "connectionPassword") != null) {
            this.text[1].setText(getOptionValue(gbean,
                "connectionPassword"));
            this.text[2].setText(getOptionValue(gbean,
                "connectionPassword"));
        }
        if (getOptionValue(gbean, "connectionProtocol") != null) {
            this.text[3].setText(getOptionValue(gbean,
                "connectionProtocol"));
        }
        if (getOptionValue(gbean, "authentication") != null) {
            this.combo[2].setText(getOptionValue(gbean,
                "authentication"));
        }

        }

        setControl(composite);
    }

    public IWizardPage getNextPage() {
        return this.getWizard().getPage("LDAPSearchPage");
    }

    }

    public class LDAPSearchPage extends WizardPage {
    Text[] text = new Text[6];
    Button userSearchSubtree, roleSearchSubtree;

    protected LDAPSearchPage(String pageName) {
        super(pageName);
        setTitle(Messages.ldapRealmSearchConfig);
        setDescription(Messages.editLdapRealmSearch);
    }

    public void createControl(Composite parent) {
        Composite composite = new Composite(parent, SWT.NULL);
        GridLayout layout = new GridLayout();
        layout.numColumns = 2;
        composite.setLayout(layout);
        GridData data = new GridData();
        data.verticalAlignment = GridData.FILL;
        data.horizontalAlignment = GridData.FILL;
        data.widthHint = 300;
        composite.setLayoutData(data);

        Group userGroup = new Group(composite, SWT.NULL);
        userGroup.setText(Messages.userSearchConfig);
        GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 4;
        GridData data1 = new GridData();
        data1.horizontalAlignment = GridData.FILL;
        data1.grabExcessHorizontalSpace = true;
        data1.horizontalSpan = 2;
        userGroup.setLayout(gridLayout);
        userGroup.setLayoutData(data1);

        createLabel(userGroup, Messages.userBase, 1);
        text[0] = createText(userGroup, 3);
        createLabel(userGroup, Messages.userSearchMachting, 1);
        text[1] = createText(userGroup, 3);
        userSearchSubtree = new Button(userGroup, SWT.CHECK);
        userSearchSubtree.setText(Messages.userSearchSubtree);
        userSearchSubtree.setLayoutData(new GridData(GridData.FILL,
            GridData.FILL, true, false, 4, 1));
        userSearchSubtree.setSelection(true);

        Group roleGroup = new Group(composite, SWT.NULL);
        roleGroup.setText(Messages.roleSearchConfig);
        gridLayout = new GridLayout();
        gridLayout.numColumns = 4;
        data1 = new GridData();
        data1.horizontalAlignment = GridData.FILL;
        data1.grabExcessHorizontalSpace = true;
        data1.horizontalSpan = 2;
        roleGroup.setLayout(gridLayout);
        roleGroup.setLayoutData(data1);
        createLabel(roleGroup, Messages.roleBase, 1);
        text[2] = createText(roleGroup, 3);
        createLabel(roleGroup, Messages.roleName, 1);
        text[3] = createText(roleGroup, 3);
        createLabel(roleGroup, Messages.roleUserSearchStr, 1);
        text[4] = createText(roleGroup, 3);
        createLabel(roleGroup, Messages.userRoleSearchStr, 1);
        text[5] = createText(roleGroup, 3);
        roleSearchSubtree = new Button(roleGroup, SWT.CHECK);
        roleSearchSubtree.setText(Messages.roleSearchSubtree);
        roleSearchSubtree.setLayoutData(new GridData(GridData.FILL,
            GridData.FILL, true, false, 4, 1));
        roleSearchSubtree.setSelection(true);

        if (eObject != null) {
        Gbean gbean = (Gbean) ((JAXBElement<?>) eObject).getValue();
        if (getOptionValue(gbean, "userBase") != null) {
            text[0].setText(getOptionValue(gbean, "userBase"));
        }
        if (getOptionValue(gbean, "userSearchMatching") != null) {
            text[1]
                .setText(getOptionValue(gbean, "userSearchMatching"));
        }
        if (getOptionValue(gbean, "userSearchSubtree") != null) {
            this.userSearchSubtree.setSelection(Boolean
                .parseBoolean(getOptionValue(gbean,
                    "userSearchSubtree")));
        }
        if (getOptionValue(gbean, "roleBase") != null) {
            text[2].setText(getOptionValue(gbean, "roleBase"));
        }
        if (getOptionValue(gbean, "roleName") != null) {
            text[3].setText(getOptionValue(gbean, "roleName"));
        }
        if (getOptionValue(gbean, "roleSearchMatching") != null) {
            text[4]
                .setText(getOptionValue(gbean, "roleSearchMatching"));
        }
        if (getOptionValue(gbean, "userRoleName") != null) {
            text[5].setText(getOptionValue(gbean, "userRoleName"));
        }
        if (getOptionValue(gbean, "roleSearchSubtree") != null) {
            this.userSearchSubtree.setSelection(Boolean
                .parseBoolean(getOptionValue(gbean,
                    "roleSearchSubtree")));
        }
        }

        setControl(composite);
    }

    public boolean canFlipToNextPage() {
        // no next page for this path through the wizard
        return false;
    }

    public IWizardPage getNextPage() {
        return null;
    }

    }

    private String getAttributeValue(Gbean gbean, String attributeName) {
    try {
        List<JAXBElement<?>> elelist = gbean
            .getAttributeOrXmlAttributeOrReference();
        for (JAXBElement<?> ele : elelist) {
        if (Attribute.class.isInstance(ele.getValue())
            && ((Attribute) ele.getValue()).getName().equals(
                attributeName)) {
            return ((Attribute) ele.getValue()).getValue();
        }
        }
    } catch (NullPointerException e) {
        // ignore
    }
    return null;
    }

    private String getLoginModuleClass(Gbean gbean) {

    try {
        List<JAXBElement<?>> elelist = gbean
            .getAttributeOrXmlAttributeOrReference();
        for (JAXBElement<?> ele : elelist) {
            if (XmlAttributeType.class.isInstance(ele.getValue())
                && ((XmlAttributeType) ele.getValue()).getName()
                    .equals("LoginModuleConfiguration")) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



