public void createControl()

in plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ExtModuleWizard.java [90:253]


        public void createControl(Composite parent) {
            Composite composite = createComposite(parent);
            GridData data;
            ExtModule extModule = (ExtModule)eObject;
            
            // First we need a set of radio buttons to determine what kind of module we are
            // dealing with.
            Group group = new Group (composite, SWT.NONE);
            Button button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.connector);
            buttonList[0] = button;
            button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.ejb);
            buttonList[1] = button;
            button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.java);
            buttonList[2] = button;
            button = new Button (group, SWT.RADIO);
            button.setText(CommonMessages.web);
            buttonList[3] = button;
            GridLayout gridLayout = new GridLayout();
            gridLayout.numColumns = 4;
            group.setLayout(gridLayout);
            data = new GridData();
            data.horizontalAlignment = GridData.FILL;
            data.grabExcessHorizontalSpace = true;
            data.horizontalSpan = 2;
            group.setLayoutData(data);
            
            Group group2 = new Group (composite, SWT.NONE);
            for (int i = 1; i < section.getTableColumnNames().length; i++) {
                if (i == 2) {
                    button = new Button (group2, SWT.RADIO);
                    button.setText(CommonMessages.internalPath);
                    buttonList[4] = button;
                    data = new GridData();
                    data.horizontalAlignment = GridData.FILL;
                    data.horizontalSpan = 2;
                    button.setLayoutData(data);
                }
                if (i == 3) {
                    button = new Button (group2, SWT.RADIO);
                    button.setText(CommonMessages.externalPath);
                    buttonList[5] = button;
                    data = new GridData();
                    data.horizontalAlignment = GridData.FILL;
                    data.horizontalSpan = 2;
                    button.setLayoutData(data);
                }
                Text text;

                if (i == 1) {
                    Label label = new Label(group, SWT.LEFT);
                    String columnName = section.getTableColumnNames()[i];
                    if (!columnName.endsWith(":"))
                        columnName = columnName.concat(":");
                    label.setText(columnName);
                    data = new GridData();
                    data.horizontalAlignment = GridData.FILL;
                    label.setLayoutData(data);

                    text = new Text(group, SWT.SINGLE | SWT.BORDER);
                    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
                            | GridData.VERTICAL_ALIGN_FILL);
                    data.grabExcessHorizontalSpace = true;
                    data.widthHint = 100;
                    data.horizontalSpan = 3;
                    text.setLayoutData(data);
                }
                else {
                    Label label = new Label(group2, SWT.LEFT);
                    String columnName = section.getTableColumnNames()[i];
                    if (!columnName.endsWith(":"))
                        columnName = columnName.concat(":");
                    label.setText(columnName);
                    data = new GridData();
                    data.horizontalAlignment = GridData.FILL;
                    label.setLayoutData(data);

                    text = new Text(group2, SWT.SINGLE | SWT.BORDER);
                    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
                            | GridData.VERTICAL_ALIGN_FILL);
                    data.grabExcessHorizontalSpace = true;
                    data.widthHint = 100;
                    text.setLayoutData(data);
                }

                if (extModule != null) {
                    if (i == 1) {
                        if (extModule.getConnector() != null) {
                            text.setText(extModule.getConnector().getValue());
                            buttonList[0].setSelection(true);
                        }
                        else if (extModule.getEjb() != null) {
                            text.setText(extModule.getEjb().getValue());
                            buttonList[1].setSelection(true);
                        }
                        else if (extModule.getJava() != null) {
                            text.setText(extModule.getJava().getValue());
                            buttonList[2].setSelection(true);
                        }
                        else if (extModule.getWeb() != null) {
                            text.setText(extModule.getWeb().getValue());
                            buttonList[3].setSelection(true);
                        }                        
                    }
                    else if (i == 2 && extModule.getInternalPath() != null) {
                        text.setText(extModule.getInternalPath());
                    }
                    else if (i > 2 && extModule.getExternalPath() != null) {
                        Pattern pattern = extModule.getExternalPath();
                        String value;
						try {
							value = (String) JAXBUtils.getValue(pattern,getTableColumnEAttributes()[i]);
						} catch (Exception e1) {
							value = e1.getMessage();
						}
                        if (value != null) {
                            text.setText(value);
                        }
                    }
                }
                textEntries[i - 1] = text;
            }
            gridLayout = new GridLayout();
            gridLayout.numColumns = 2;
            group2.setLayout(gridLayout);
            data = new GridData();
            data.horizontalAlignment = GridData.FILL;
            data.grabExcessHorizontalSpace = true;
            data.horizontalSpan = 2;
            group2.setLayoutData(data);

            buttonList[4].addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
                    if (buttonList[4].getSelection()) {
                       toggle();
                    }
                }
            });
            buttonList[5].addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
                    if (buttonList[5].getSelection()) {
                        toggle();
                    }
                }
            });

            if (extModule == null) {
                buttonList[0].setSelection(true);
                buttonList[4].setSelection(true);
            }
            else if (extModule.getInternalPath() != null) {
                buttonList[4].setSelection(true);
            }
            else {
                buttonList[5].setSelection(true);
            }
            toggle();

            doCustom(composite);
            setControl(composite);
            textEntries[0].setFocus();
        }