public void createControl()

in plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/SecurityRealmWizard.java [724:850]


    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 databasePoolGroup = new Group(composite, SWT.NONE);
        databasePoolGroup.setText(CommonMessages.dataBasePool);
        GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 4;
        GridData data1 = new GridData();
        data1.horizontalAlignment = GridData.FILL;
        data1.grabExcessHorizontalSpace = true;
        data1.horizontalSpan = 2;
        databasePoolGroup.setLayout(gridLayout);
        databasePoolGroup.setLayoutData(data1);
        buttons[0] = new Button(databasePoolGroup, SWT.RADIO);
        buttons[0].setSelection(true);
        buttons[0].setText(CommonMessages.useDataBasePool);
        buttons[0].setLayoutData(new GridData(GridData.FILL,
            GridData.CENTER, true, false, 4, 1));
        buttons[0].addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            buttons[1].setSelection(false);
            dataBasePoolCombo.setEnabled(true);
            for (int i = 0; i < textEntries.length; i++) {
            textEntries[i].setEnabled(false);
            }
        }
        });
        createLabel(databasePoolGroup, CommonMessages.dataBasePoolName, 1);
        dataBasePoolCombo = new Combo(databasePoolGroup, SWT.NONE);
        dataBasePoolCombo.setLayoutData(new GridData(GridData.FILL,
            GridData.FILL, true, false, 3, 1));
        populateList(dataBasePoolCombo);
        dataBasePoolCombo.select(0);

        GridData data2 = new GridData();
        data2.horizontalAlignment = GridData.FILL;
        data2.grabExcessHorizontalSpace = true;
        data2.horizontalSpan = 2;
        Group databaseGroup = new Group(composite, SWT.NONE);
        databaseGroup.setLayout(gridLayout);
        databaseGroup.setLayoutData(data2);
        buttons[1] = new Button(databaseGroup, SWT.RADIO);
        buttons[1].setText(CommonMessages.useDataBase);
        buttons[1].setLayoutData(new GridData(GridData.FILL, GridData.FILL,
            true, false, 4, 1));
        buttons[1].addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            buttons[0].setSelection(false);
            dataBasePoolCombo.setEnabled(false);
            for (int i = 0; i < textEntries.length; i++) {
            textEntries[i].setEnabled(true);
            }
        }
        });
        createLabel(databaseGroup, CommonMessages.jdbcDriverClass, 1);
        textEntries[0] = createText(databaseGroup, 3);

        createLabel(databaseGroup, CommonMessages.jdbcURL, 1);
        textEntries[1] = createText(databaseGroup, 3);
        createLabel(databaseGroup, CommonMessages.jdbcUserName, 1);
        textEntries[2] = createText(databaseGroup, 3);
        createLabel(databaseGroup, CommonMessages.jdbcPassword, 1);
        textEntries[3] = createText(databaseGroup, 1);
        textEntries[3].setEchoChar('*');
        createLabel(databaseGroup, CommonMessages.confirmPassword, 1);
        textEntries[4] = createText(databaseGroup, 1);
        textEntries[4].setEchoChar('*');

        dataBasePoolCombo.setEnabled(true);
        for (int i = 0; i < textEntries.length; i++) {
        textEntries[i].setEnabled(false);
        }

        if (eObject != null) {
        Gbean gbean = (Gbean) ((JAXBElement) eObject).getValue();
        if (getOptionValue(gbean, "dataSourceName") != null) {
            this.buttons[0].setSelection(true);
            this.dataBasePoolCombo.setEnabled(true);
            this.dataBasePoolCombo.setText(getOptionValue(gbean,
                "dataSourceName"));

            this.buttons[1].setSelection(false);
            for (int i = 0; i < textEntries.length; i++) {
            this.textEntries[i].setEnabled(false);
            }

        } else {
            this.buttons[1].setSelection(true);
            this.buttons[0].setSelection(false);
            this.dataBasePoolCombo.setEnabled(false);
            for (int i = 0; i < textEntries.length; i++) {
            textEntries[i].setEnabled(true);
            }

            if (getOptionValue(gbean, "jdbcDriver") != null) {
            this.textEntries[0].setText(getOptionValue(gbean,
                "jdbcDriver"));
            }
            if (getOptionValue(gbean, "jdbcURL") != null) {
            this.textEntries[1].setText(getOptionValue(gbean,
                "jdbcURL"));
            }
            if (getOptionValue(gbean, "jdbcUser") != null) {
            this.textEntries[2].setText(getOptionValue(gbean,
                "jdbcUser"));
            }
            if (getOptionValue(gbean, "jdbcPassword") != null) {
            this.textEntries[3].setText(getOptionValue(gbean,
                "jdbcPassword"));
            this.textEntries[4].setText(getOptionValue(gbean,
                "jdbcPassword"));
            }
        }

        }

        setControl(composite);

    }