Package org.apache.geronimo.jee.application

Examples of org.apache.geronimo.jee.application.Module


    }

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

        if (eObject == null) {
            eObject = getEFactory().create(Module.class);
            JAXBElement plan = section.getPlan();

            module = (Module)eObject;

            List moduleList = ((Application)plan.getValue()).getModule();
            if (moduleList == null) {
                moduleList = (List)getEFactory().create(Module.class);
            }
            moduleList.add(eObject);
        }
        else {
            module = (Module)eObject;
            module.setConnector(null);
            module.setEjb(null);
            module.setJava(null);
            module.setWeb(null);
        }

        // NOTE!! this replaces the call to processEAttributes (page);
        path = (Path)getEFactory().create(Path.class);
        path.setValue(page.getTextEntry(0).getText());

        if (((ModuleWizardPage)page).buttonList[0].getSelection())
            module.setConnector(path);
        else if (((ModuleWizardPage)page).buttonList[1].getSelection())
            module.setEjb(path);
        else if (((ModuleWizardPage)page).buttonList[2].getSelection())
            module.setJava(path);
        else if (((ModuleWizardPage)page).buttonList[3].getSelection())
            module.setWeb(path);
       
        String altDD = page.getTextEntry(1).getText();
        path = (Path)getEFactory().create(Path.class);
        path.setValue(altDD);
        module.setAltDd(path);
       
        if (section.getViewer().getInput() == section.getPlan()) {
            section.getViewer().setInput(section.getInput());
        }
View Full Code Here


        }

        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;
            }
View Full Code Here

    public ITableLabelProvider getLabelProvider() {
        return new LabelProvider() {
            @Override
            public String getColumnText(Object element, int columnIndex) {
                if (Module.class.isInstance(element)) {
                    Module module = (Module) element;
                    switch (columnIndex) {
                    case 0:
                        if (module.getConnector() != null) {
                            return "connector";
                        } else if (module.getEjb() != null) {
                            return "ejb";
                        } else if (module.getJava() != null) {
                            return "java";
                        } else if (module.getWeb() != null) {
                            return "web";
                        }
                        return "";
                    case 1:
                        if (module.getConnector() != null) {
                            return module.getConnector().getValue();
                        } else if (module.getEjb() != null) {
                            return module.getEjb().getValue();
                        } else if (module.getJava() != null) {
                            return module.getJava().getValue();
                        } else if (module.getWeb() != null) {
                            return module.getWeb().getValue();
                        }
                        return "";
                    case 2:
                        if (module.getAltDd() != null) {
                            return module.getAltDd().getValue();
                        }
                        return "";
                    }
                }
                return null;
View Full Code Here

TOP

Related Classes of org.apache.geronimo.jee.application.Module

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.