plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.java [52:199]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super();
        this.customAssembly = customAssembly;
    }

    public void addPages() {
        addPage(new ServerCustomAssemblyWizardPage("page0"));
    }

    public class ServerCustomAssemblyWizardPage extends AbstractWizardPage {

        public ServerCustomAssemblyWizardPage(String pageName) {
            super(pageName);
        }

        public void createControl(Composite parent) {
            parent.setLayoutData(createGridData());
            Composite composite = createComposite(parent);

            createLabel(composite, CommonMessages.groupId);
            group = createTextField(composite, "");
            createLabel(composite, CommonMessages.artifactId);
            artifact = createTextField(composite, "");
            createLabel(composite, CommonMessages.version);
            version = createTextField(composite, "1.0");
            createLabel(composite, CommonMessages.type);
            type = createTextField(composite, "tar.gz");
            createLabel(composite, CommonMessages.path);
            serverPath = createTextField(composite, "var/temp/assembly");
            createTable(composite);
            populateTable();

            group.addModifyListener(new ModifyListener(){
				public void modifyText(ModifyEvent arg0) {
					ServerCustomAssemblyWizard.this.getContainer().updateButtons();
				}
            });
            artifact.addModifyListener(new ModifyListener(){
				public void modifyText(ModifyEvent arg0) {
					ServerCustomAssemblyWizard.this.getContainer().updateButtons();
				}
            });
            version.addModifyListener(new ModifyListener(){
				public void modifyText(ModifyEvent arg0) {
					ServerCustomAssemblyWizard.this.getContainer().updateButtons();
				}
            });
            type.addModifyListener(new ModifyListener(){
				public void modifyText(ModifyEvent arg0) {
					ServerCustomAssemblyWizard.this.getContainer().updateButtons();
				}
            });
            serverPath.addModifyListener(new ModifyListener(){
				public void modifyText(ModifyEvent arg0) {
					ServerCustomAssemblyWizard.this.getContainer().updateButtons();
				}
            });
            pluginTable.addSelectionListener(new SelectionAdapter(){
				public void widgetSelected(SelectionEvent arg0) {
					ServerCustomAssemblyWizard.this.getContainer().updateButtons();
				}
            });
            
            setControl(composite);
        }

        public GridData createGridData() {
            GridData data = new GridData();
            data.verticalAlignment = GridData.FILL;
            data.horizontalAlignment = GridData.FILL;
            data.grabExcessVerticalSpace = true;
            data.grabExcessHorizontalSpace = true;
            data.heightHint = 400;
            data.widthHint = 300;
            return data;
        }

        private void createTable(Composite composite) {
            int style = SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION;

            pluginTable = new Table(composite, style);
            GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
            data.grabExcessHorizontalSpace = true;
            data.grabExcessVerticalSpace = true;
            data.horizontalSpan = 2;
            data.horizontalAlignment = GridData.FILL;
            data.heightHint = 250;
            data.widthHint = 350;
            pluginTable.setLayoutData(data);
            pluginTable.setLinesVisible(false);
            pluginTable.setHeaderVisible(true);

            final TableColumn[] column = new TableColumn[1];
            column[0] = new TableColumn(pluginTable, SWT.LEFT, 0);
            column[0].setText(CommonMessages.plugin);
            column[0].setWidth(400);
        }

        public void populateTable() {
            List<String> pluginList = customAssembly.getPluginList();
             
            for (int i = 0; i < pluginList.size(); ++i) {
                TableItem tableItem = new TableItem(pluginTable, SWT.NONE);
                String tableEntry = pluginList.get(i);
                tableItem.setData(tableEntry);
                tableItem.setText(new String[] {tableEntry});
            }
        }

        @Override
        protected String getWizardPageTitle() {
            return CommonMessages.wizardPageTitle_ServerCustomAssembly;
        }

        @Override
        protected String getWizardPageDescription() {
            return CommonMessages.wizardPageDescription_ServerCustomAssembly;
        }
        
        
    }

    public boolean performFinish() {
        if (isEmpty(group.getText()) || isEmpty(artifact.getText()) ||
            isEmpty(version.getText()) || isEmpty(type.getText()) ||
            isEmpty(serverPath.getText()) || pluginTable.getSelectionCount() == 0) {
            return false;
        }
        customAssembly.assembleServer(group.getText(), artifact.getText(), version.getText(), type.getText(), 
                serverPath.getText(), pluginTable.getSelectionIndices());
        return true;
    }

    @Override
    protected String getAddWizardWindowTitle() {
        return CommonMessages.wizardNewTitle_ServerCustomAssembly;
    }

    @Override
    protected String getEditWizardWindowTitle() {
        return CommonMessages.wizardNewTitle_ServerCustomAssembly;
    }
    
    public boolean canFinish(){
    	 if (isEmpty(group.getText()) || isEmpty(artifact.getText()) ||
    	            isEmpty(version.getText()) || isEmpty(type.getText()) ||
    	            isEmpty(serverPath.getText()) || pluginTable.getSelectionCount() == 0) {
    		 return false;
    	 }else return true;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/ServerCustomAssemblyWizard.java [52:199]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super();
        this.customAssembly = customAssembly;
    }

    public void addPages() {
        addPage(new ServerCustomAssemblyWizardPage("page0"));
    }

    public class ServerCustomAssemblyWizardPage extends AbstractWizardPage {

        public ServerCustomAssemblyWizardPage(String pageName) {
            super(pageName);
        }

        public void createControl(Composite parent) {
            parent.setLayoutData(createGridData());
            Composite composite = createComposite(parent);

            createLabel(composite, CommonMessages.groupId);
            group = createTextField(composite, "");
            createLabel(composite, CommonMessages.artifactId);
            artifact = createTextField(composite, "");
            createLabel(composite, CommonMessages.version);
            version = createTextField(composite, "1.0");
            createLabel(composite, CommonMessages.type);
            type = createTextField(composite, "tar.gz");
            createLabel(composite, CommonMessages.path);
            serverPath = createTextField(composite, "var/temp/assembly");
            createTable(composite);
            populateTable();

            group.addModifyListener(new ModifyListener(){
                public void modifyText(ModifyEvent arg0) {
                    ServerCustomAssemblyWizard.this.getContainer().updateButtons();
                }
            });
            artifact.addModifyListener(new ModifyListener(){
                public void modifyText(ModifyEvent arg0) {
                    ServerCustomAssemblyWizard.this.getContainer().updateButtons();
                }
            });
            version.addModifyListener(new ModifyListener(){
                public void modifyText(ModifyEvent arg0) {
                    ServerCustomAssemblyWizard.this.getContainer().updateButtons();
                }
            });
            type.addModifyListener(new ModifyListener(){
                public void modifyText(ModifyEvent arg0) {
                    ServerCustomAssemblyWizard.this.getContainer().updateButtons();
                }
            });
            serverPath.addModifyListener(new ModifyListener(){
                public void modifyText(ModifyEvent arg0) {
                    ServerCustomAssemblyWizard.this.getContainer().updateButtons();
                }
            });
            pluginTable.addSelectionListener(new SelectionAdapter(){
                public void widgetSelected(SelectionEvent arg0) {
                    ServerCustomAssemblyWizard.this.getContainer().updateButtons();
                }
            });
            
            setControl(composite);
        }

        public GridData createGridData() {
            GridData data = new GridData();
            data.verticalAlignment = GridData.FILL;
            data.horizontalAlignment = GridData.FILL;
            data.grabExcessVerticalSpace = true;
            data.grabExcessHorizontalSpace = true;
            data.heightHint = 400;
            data.widthHint = 300;
            return data;
        }

        private void createTable(Composite composite) {
            int style = SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION;

            pluginTable = new Table(composite, style);
            GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
            data.grabExcessHorizontalSpace = true;
            data.grabExcessVerticalSpace = true;
            data.horizontalSpan = 2;
            data.horizontalAlignment = GridData.FILL;
            data.heightHint = 250;
            data.widthHint = 350;
            pluginTable.setLayoutData(data);
            pluginTable.setLinesVisible(false);
            pluginTable.setHeaderVisible(true);

            final TableColumn[] column = new TableColumn[1];
            column[0] = new TableColumn(pluginTable, SWT.LEFT, 0);
            column[0].setText(CommonMessages.plugin);
            column[0].setWidth(400);
        }

        public void populateTable() {
            List<String> pluginList = customAssembly.getPluginList();
             
            for (int i = 0; i < pluginList.size(); ++i) {
                TableItem tableItem = new TableItem(pluginTable, SWT.NONE);
                String tableEntry = pluginList.get(i);
                tableItem.setData(tableEntry);
                tableItem.setText(new String[] {tableEntry});
            }
        }

        @Override
        protected String getWizardPageTitle() {
            return CommonMessages.wizardPageTitle_ServerCustomAssembly;
        }

        @Override
        protected String getWizardPageDescription() {
            return CommonMessages.wizardPageDescription_ServerCustomAssembly;
        }
        
        
    }

    public boolean performFinish() {
        if (isEmpty(group.getText()) || isEmpty(artifact.getText()) ||
            isEmpty(version.getText()) || isEmpty(type.getText()) ||
            isEmpty(serverPath.getText()) || pluginTable.getSelectionCount() == 0) {
            return false;
        }
        customAssembly.assembleServer(group.getText(), artifact.getText(), version.getText(), type.getText(), 
                serverPath.getText(), pluginTable.getSelectionIndices());
        return true;
    }

    @Override
    protected String getAddWizardWindowTitle() {
        return CommonMessages.wizardNewTitle_ServerCustomAssembly;
    }

    @Override
    protected String getEditWizardWindowTitle() {
        return CommonMessages.wizardNewTitle_ServerCustomAssembly;
    }
    
    public boolean canFinish(){
         if (isEmpty(group.getText()) || isEmpty(artifact.getText()) ||
                    isEmpty(version.getText()) || isEmpty(type.getText()) ||
                    isEmpty(serverPath.getText()) || pluginTable.getSelectionCount() == 0) {
             return false;
         }else return true;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



