Package org.apache.geronimo.jee.application

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


      public Object[] getElements(Object inputElement) {
    List<ExtModule> result = new ArrayList<ExtModule>();
    List extModules = getObjectContainer();
    Iterator it = extModules.iterator();
    while (it.hasNext()) {
        ExtModule current = (ExtModule) it.next();
        if (isDBPoolConnectorExtModule(current)) {
      result.add(current);
        }
    }
    return result.toArray();
View Full Code Here


    public ITableLabelProvider getLabelProvider() {
  return new LabelProvider() {
      @Override
      public String getColumnText(Object element, int columnIndex) {
    if (ExtModule.class.isInstance(element)) {
        ExtModule extModule = (ExtModule) element;
        switch (columnIndex) {
        case 0:// connector
      if (extModule.getConnector() != null) {
          return extModule.getConnector().getValue();
      }
      return "";
        case 1:// external-path
      Pattern externalPath = extModule.getExternalPath();
      if (externalPath != null) {
          String groupId = externalPath.getGroupId() != null ? externalPath
            .getGroupId()
            : "";
          String artifactId = externalPath.getArtifactId() != null ? externalPath
View Full Code Here

  public ITableLabelProvider getLabelProvider() {
    return new LabelProvider() {
      @Override
      public String getColumnText(Object element, int columnIndex) {
        if (ExtModule.class.isInstance(element)) {
          ExtModule extModule = (ExtModule) element;
          switch (columnIndex) {
          case 0:
            if (extModule.getConnector() != null) {
              return "connector";
            } else if (extModule.getEjb() != null) {
              return "ejb";
            } else if (extModule.getJava() != null) {
              return "java";
            } else if (extModule.getWeb() != null) {
              return "web";
            }
            return "";
          case 1:
            if (extModule.getConnector() != null) {
              return extModule.getConnector().getValue();
            } else if (extModule.getEjb() != null) {
              return extModule.getEjb().getValue();
            } else if (extModule.getJava() != null) {
              return extModule.getJava().getValue();
            } else if (extModule.getWeb() != null) {
              return extModule.getWeb().getValue();
            }
            return "";
          case 2:
            if (extModule.getInternalPath() != null) {
              return extModule.getInternalPath();
            }
            return "";
          case 3:
            if (extModule.getExternalPath() != null) {
              return extModule.getExternalPath().getGroupId();
            }
            return "";
          case 4:
            if (extModule.getExternalPath() != null) {
              return extModule.getExternalPath().getArtifactId();
            }
            return "";
          case 5:
            if (extModule.getExternalPath() != null) {
              return extModule.getExternalPath().getVersion();
            }
            return "";
          case 6:
            if (extModule.getExternalPath() != null) {
              return extModule.getExternalPath().getType();
            }
            return "";
          }
        }
        return null;
View Full Code Here

    if (!dependencies.getDependency().contains(selectedDependency)) {
        dependencies.getDependency().add(selectedDependency);
    }
      }

      ExtModule extModule;
      if (eObject == null) {
    eObject = getEFactory().create(ExtModule.class);
    extModule = (ExtModule) eObject;
    java.util.List<ExtModule> extModuleList = application
      .getExtModule();
    extModuleList.add(extModule);
      } else {
    extModule = (ExtModule) eObject;
      }

      // NOTE!! this replaces the call to processEAttributes (page);
      Path path = (Path) getEFactory().create(Path.class);
      path.setValue(page0.text[0].getText());
      extModule.setConnector(path);

      Pattern pattern = (Pattern) getEFactory().create(Pattern.class);
      extModule.setExternalPath(pattern);
      pattern.setGroupId(page0.text[1].getText());
      pattern.setArtifactId(page0.text[2].getText());
      //empty version element will cause deploy failure
      String version = page0.text[3].getText();
      if (version!=null && version.length()!=0)
        pattern.setVersion(page0.text[3].getText());
      pattern.setType(page0.text[4].getText().trim());

      Connector conn = new Connector();
      // attention here <connector/> is unmashalled as a JAXBElement
      JAXBElement<Connector> connElement = (new org.apache.geronimo.jee.connector.ObjectFactory())
        .createConnector(conn);
      extModule.setAny(connElement);
      Resourceadapter adapter = new Resourceadapter();
      conn.getResourceadapter().add(adapter);

      OutboundResourceadapter outboundAdpater = new OutboundResourceadapter();
      ConnectionDefinition definition = new ConnectionDefinition();
View Full Code Here

      text[4] = new Text(group2, SWT.SINGLE | SWT.BORDER);
      text[4].setLayoutData(textGridData);

      // if edit a pool,the info must be filled into wizard
      if (eObject != null && ExtModule.class.isInstance(eObject)) {
    ExtModule extModule = (ExtModule) eObject;
    if (extModule.getConnector() != null) {
        text[0].setText(extModule.getConnector().getValue());
    }
    if (extModule.getExternalPath() != null) {
        text[1]
          .setText(extModule.getExternalPath().getGroupId() == null ? ""
            : extModule.getExternalPath().getGroupId());
        text[2]
          .setText(extModule.getExternalPath()
            .getArtifactId() == null ? "" : extModule
            .getExternalPath().getArtifactId());
        text[3]
          .setText(extModule.getExternalPath().getVersion() == null ? ""
            : extModule.getExternalPath().getVersion());
        text[4]
          .setText(extModule.getExternalPath().getType() == null ? ""
            : extModule.getExternalPath().getType());
    }
      }

      setControl(composite);
  }
View Full Code Here

      Menu menu = popupMenu.createContextMenu(list);
      list.setMenu(menu);

      // if edit a pool,the info must be filled into wizard
      if (eObject != null && ExtModule.class.isInstance(eObject)) {
    ExtModule extModule = (ExtModule) eObject;

    try {
        ConnectiondefinitionInstance conndefInstance = ((JAXBElement<Connector>) extModule
          .getAny()).getValue().getResourceadapter().get(0)
          .getOutboundResourceadapter()
          .getConnectionDefinition().get(0)
          .getConnectiondefinitionInstance().get(0);
        text[0].setText(conndefInstance.getName());
View Full Code Here

      text[3].setEchoChar('*');
      text[3].setText("manager");

      // if edit a pool,the info must be filled into wizard
      if (eObject != null && ExtModule.class.isInstance(eObject)) {
    ExtModule extModule = (ExtModule) eObject;
    try {
        ConnectiondefinitionInstance conndefInstance = ((JAXBElement<Connector>) extModule
          .getAny()).getValue().getResourceadapter().get(0)
          .getOutboundResourceadapter()
          .getConnectionDefinition().get(0)
          .getConnectiondefinitionInstance().get(0);
        java.util.List<ConfigPropertySetting> configPropertySettingList = conndefInstance
View Full Code Here

      createLabel(connectionGroup, CommonMessages.idleTimeout, 2);
      text[3] = createText(connectionGroup, 2);

      // if edit a pool,the info must be filled into wizard
      if (eObject != null && ExtModule.class.isInstance(eObject)) {
    ExtModule extModule = (ExtModule) eObject;
    try {
        ConnectiondefinitionInstance conndefInstance = ((JAXBElement<Connector>) extModule
          .getAny()).getValue().getResourceadapter().get(0)
          .getOutboundResourceadapter()
          .getConnectionDefinition().get(0)
          .getConnectiondefinitionInstance().get(0);
View Full Code Here

    }
   
    public boolean performFinish() {
        ModuleWizardPage page = (ModuleWizardPage) getPages()[0];
        Path path;
        ExtModule extModule;

        if (eObject == null) {
            eObject = getEFactory().create(ExtModule.class);
            JAXBElement plan = section.getPlan();
            extModule = (ExtModule)eObject;
            //This is the extModule field in plan(Application Type)
            List<ExtModule> extModuleList = ((Application)plan.getValue()).getExtModule();
            extModuleList.add(extModule);
        }
        else {
            extModule = (ExtModule)eObject;
            extModule.setConnector(null);
            extModule.setEjb(null);
            extModule.setJava(null);
            extModule.setWeb(null);
            extModule.setExternalPath(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())
            extModule.setConnector(path);
        else if (((ModuleWizardPage)page).buttonList[1].getSelection())
            extModule.setEjb(path);
        else if (((ModuleWizardPage)page).buttonList[2].getSelection())
            extModule.setJava(path);
        else if (((ModuleWizardPage)page).buttonList[3].getSelection())
            extModule.setWeb(path);

        if (page.buttonList[4].getSelection()) {
            extModule.setInternalPath (page.getTextEntry(1).getText());
            extModule.setExternalPath(null);
        }
        else if (page.buttonList[5].getSelection()) {
            Pattern pattern = (Pattern)getEFactory().create(Pattern.class);
            extModule.setExternalPath(pattern);
            for (int i = 2; i < 6; i++) {
                String value = page.getTextEntry(i).getText();
                String attribute = getTableColumnEAttributes()[i + 1];
                try {
          JAXBUtils.setValue(pattern, attribute, value);
        } catch (Exception e) {
          MessageDialog.openError(Display.getCurrent().getActiveShell(),"Error", e.getMessage());
        }
            }
            extModule.setInternalPath(null);
        }

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

TOP

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

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.