Esempio n. 1
0
  private void populateOperationCombo() {
    if (_operationSelectionCombo != null && !_operationSelectionCombo.isDisposed()) {
      _operationSelectionCombo.removeAll();
      _operationSelectionCombo.clearSelection();

      if (getTargetObject() == null) {
        PictogramElement[] pes =
            SwitchyardSCAEditor.getActiveEditor().getSelectedPictogramElements();
        if (pes.length > 0) {
          Object bo =
              SwitchyardSCAEditor.getActiveEditor()
                  .getDiagramTypeProvider()
                  .getFeatureProvider()
                  .getBusinessObjectForPictogramElement(pes[0]);
          if (bo instanceof Contract) {
            setTargetObject(bo);
          }
        }
      }
      if (getTargetObject() != null && getTargetObject() instanceof Contract) {
        String[] operations = InterfaceOpsUtil.gatherOperations((Contract) getTargetObject());
        for (int i = 0; i < operations.length; i++) {
          _operationSelectionCombo.add(operations[i]);
        }
      }
    }
  }
 private void addDomainListener() {
   if (_domain == null) {
     _domain =
         (TransactionalEditingDomainImpl) SwitchyardSCAEditor.getActiveEditor().getEditingDomain();
     _domain.addResourceSetListener(this);
   }
 }
Esempio n. 3
0
 /**
  * @param validator transform to check
  * @return String label
  */
 private static String getLabelForValidatorType(ValidateType validator) {
   String label = "Unsupported (" + validator.eClass().getClass().getName() + ")";
   if (validator instanceof XmlValidateType) {
     label = "XML";
   } else if (validator instanceof JavaValidateType) {
     label = "Java";
   }
   URI _modelUri =
       URI.createPlatformResourceURI(
           SwitchyardSCAEditor.getActiveEditor().getModelFile().getFullPath().toString(), true);
   if (validator.eResource() != null
       && !validator.eResource().getURI().toString().equals(_modelUri.toString())) {
     label = label + '*';
   }
   return label;
 }
Esempio n. 4
0
 /**
  * @param transform transform to check
  * @return String label
  */
 private static String getLabelForTransformType(TransformType transform) {
   String label = "Unsupported (" + transform.eClass().getClass().getName() + ")";
   if (transform instanceof JAXBTransformType) {
     label = "JAXB";
   } else if (transform instanceof XsltTransformType) {
     label = "XSLT";
   } else if (transform instanceof JavaTransformType1) {
     label = "Java";
   } else if (transform instanceof JsonTransformType) {
     label = "JSON";
   } else if (transform instanceof SmooksTransformType1) {
     label = "Smooks";
   }
   URI _modelUri =
       URI.createPlatformResourceURI(
           SwitchyardSCAEditor.getActiveEditor().getModelFile().getFullPath().toString(), true);
   if (transform.eResource() != null
       && !transform.eResource().getURI().toString().equals(_modelUri.toString())) {
     label = label + '*';
   }
   return label;
 }