plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ModuleWizard.java [43:173]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class ModuleWizard extends AbstractTableWizard {

    public ModuleWizard(AbstractTableSection section) {
        super(section);
    }

    public JAXBObjectFactory getEFactory() {
        return JAXBObjectFactoryImpl.getInstance();
    }

    public String[] getTableColumnEAttributes() {
        return new String[] { "ModuleType", "Path", "AltDd" };
    }

    public String getAddWizardWindowTitle() {
        return CommonMessages.wizardNewTitle_Module;
    }

    public String getEditWizardWindowTitle() {
        return CommonMessages.wizardEditTitle_Module;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.wizard.IWizard#addPages()
     */
    public void addPages() {
        addPage(new ModuleWizardPage("Page0"));
    }

    // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
    // the values are brought in properly.
    public class ModuleWizardPage extends AbstractTableWizardPage {
        protected Button[] buttonList = new Button[4];
        
        public ModuleWizardPage(String pageName) {
            super(pageName);
        }

        public void createControl(Composite parent) {
            Composite composite = createComposite(parent);
            GridData data;
            Module module = (Module)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;
            FillLayout fillLayout = new FillLayout();
            fillLayout.type = SWT.HORIZONTAL;
            group.setLayout(fillLayout);
            data = new GridData();
            data.horizontalAlignment = GridData.FILL;
            data.horizontalSpan = 2;
            group.setLayoutData(data);
            
            for (int i = 1; i < section.getTableColumnNames().length; i++) {
                Label label = new Label(composite, 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 text = new Text(composite, 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 (module != null) {
                    if (i == 1) {
                        if (module.getConnector() != null) {
                            text.setText(module.getConnector().getValue());
                            buttonList[0].setSelection(true);
                        }
                        else if (module.getEjb() != null) {
                            text.setText(module.getEjb().getValue());
                            buttonList[1].setSelection(true);
                        }
                        else if (module.getJava() != null) {
                            text.setText(module.getJava().getValue());
                            buttonList[2].setSelection(true);
                        }
                        else if (module.getWeb() != null) {
                            text.setText(module.getWeb().getValue());
                            buttonList[3].setSelection(true);
                        }                        
                    }
                    else if (i == 2 && module.getAltDd() != null) {
                        text.setText(module.getAltDd().getValue());
                    }
                }
                textEntries[i - 1] = text;
            }

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

        public String getWizardPageTitle() {
            return CommonMessages.wizardPageTitle_Module;
        }

        public String getWizardPageDescription() {
            return CommonMessages.wizardPageDescription_Module;
        }
    }

    public boolean performFinish() {
        AbstractTableWizardPage page = (AbstractTableWizardPage) getPages()[0];
        Path path;
        Module module;

        if (eObject == null) {
            eObject = getEFactory().create(Module.class);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/ModuleWizard.java [43:173]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class ModuleWizard extends AbstractTableWizard {

    public ModuleWizard(AbstractTableSection section) {
        super(section);
    }

    public JAXBObjectFactory getEFactory() {
        return JAXBObjectFactoryImpl.getInstance();
    }

    public String[] getTableColumnEAttributes() {
        return new String[] { "ModuleType", "Path", "AltDd" };
    }

    public String getAddWizardWindowTitle() {
        return CommonMessages.wizardNewTitle_Module;
    }

    public String getEditWizardWindowTitle() {
        return CommonMessages.wizardEditTitle_Module;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.wizard.IWizard#addPages()
     */
    public void addPages() {
        addPage(new ModuleWizardPage("Page0"));
    }

    // need to extend the DynamicWizardPage only so that when the Edit dialog is shown
    // the values are brought in properly.
    public class ModuleWizardPage extends AbstractTableWizardPage {
        protected Button[] buttonList = new Button[4];
        
        public ModuleWizardPage(String pageName) {
            super(pageName);
        }

        public void createControl(Composite parent) {
            Composite composite = createComposite(parent);
            GridData data;
            Module module = (Module)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;
            FillLayout fillLayout = new FillLayout();
            fillLayout.type = SWT.HORIZONTAL;
            group.setLayout(fillLayout);
            data = new GridData();
            data.horizontalAlignment = GridData.FILL;
            data.horizontalSpan = 2;
            group.setLayoutData(data);
            
            for (int i = 1; i < section.getTableColumnNames().length; i++) {
                Label label = new Label(composite, 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 text = new Text(composite, 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 (module != null) {
                    if (i == 1) {
                        if (module.getConnector() != null) {
                            text.setText(module.getConnector().getValue());
                            buttonList[0].setSelection(true);
                        }
                        else if (module.getEjb() != null) {
                            text.setText(module.getEjb().getValue());
                            buttonList[1].setSelection(true);
                        }
                        else if (module.getJava() != null) {
                            text.setText(module.getJava().getValue());
                            buttonList[2].setSelection(true);
                        }
                        else if (module.getWeb() != null) {
                            text.setText(module.getWeb().getValue());
                            buttonList[3].setSelection(true);
                        }                        
                    }
                    else if (i == 2 && module.getAltDd() != null) {
                        text.setText(module.getAltDd().getValue());
                    }
                }
                textEntries[i - 1] = text;
            }

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

        public String getWizardPageTitle() {
            return CommonMessages.wizardPageTitle_Module;
        }

        public String getWizardPageDescription() {
            return CommonMessages.wizardPageDescription_Module;
        }
    }

    public boolean performFinish() {
        AbstractTableWizardPage page = (AbstractTableWizardPage) getPages()[0];
        Path path;
        Module module;

        if (eObject == null) {
            eObject = getEFactory().create(Module.class);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



