Package org.openetcs.pror.tracing

Examples of org.openetcs.pror.tracing.TracingConfiguration


   * Creates a properly configured SpecRelation object between proxy and target.
   */
  private SpecRelation createLink(CompoundCommand cmd, SpecObject proxy) {
    SpecRelation link;
    link= ReqIF10Factory.eINSTANCE.createSpecRelation();
    TracingConfiguration config = getTracingConfig();
    link.setSource(config.isLinkFromTarget() ? target : proxy);
    link.setTarget(config.isLinkFromTarget() ? proxy : target);
    cmd.append(ProrUtil.createAddTypedElementCommand(
        ReqIF10Util.getReqIF(config).getCoreContent(),
        ReqIF10Package.Literals.REQ_IF_CONTENT__SPEC_RELATIONS,
        link, ReqIF10Package.Literals.SPEC_RELATION__TYPE,
        config.getLinkType(), 0, 0, domain, itemProvider.getAdapterFactory()));
    return link;
  }
View Full Code Here


  /**
   * Attempts to find a SpecRelation that: (1) connects proxy and
   * target in the right direction; and (2) has the correct type.
   */
  private SpecRelation findLinkFor(SpecObject proxy) {
    TracingConfiguration config = getTracingConfig();
    SpecObject linkSource = config.isLinkFromTarget() ? target : proxy;
    SpecObject linkTarget = config.isLinkFromTarget() ? proxy : target;
    SpecRelationType type = config.getLinkType();
   
    for (SpecRelation relation : ReqIF10Util.getReqIF(config)
        .getCoreContent().getSpecRelations()) {
      //  It's okay to compare null and references.
      if (relation.getType() == type && linkSource == relation.getSource()
View Full Code Here

  }

  private SpecObject createProxy(CompoundCommand cmd, EObject element) {
    SpecObject proxy;
    proxy = ReqIF10Factory.eINSTANCE.createSpecObject();
    TracingConfiguration config = getTracingConfig();
    AttributeValueString value = ReqIF10Factory.eINSTANCE.createAttributeValueString();
    value.setDefinition(config.getProxyAttribute());
    value.setTheValue(itemProvider.buildProxyContent(element));
    proxy.getValues().add(value);
    cmd.append(ProrUtil.createAddTypedElementCommand(
        ReqIF10Util.getReqIF(config).getCoreContent(),
        ReqIF10Package.Literals.REQ_IF_CONTENT__SPEC_OBJECTS,
        proxy, ReqIF10Package.Literals.SPEC_OBJECT__TYPE,
        config.getProxyType(), 0, 0, domain, itemProvider.getAdapterFactory()));
    return proxy;
  }
View Full Code Here

  /**
   * Tries to find the proxy with the given URI.  Returns null if not found.
   */
  SpecObject findProxyFor(EObject element) {
    TracingConfiguration config = getTracingConfig();
    String uri = EcoreUtil.getURI(element).toString();
    ReqIF reqif = ReqIF10Util.getReqIF(config);
    AttributeDefinitionString ad = config.getProxyAttribute();

    // Iterate SpecObjects and search for existing proxy element
    for (SpecObject specObject : reqif.getCoreContent().getSpecObjects()) {
      AttributeValue value = ReqIF10Util
          .getAttributeValue(specObject, ad);
View Full Code Here

   *
   * @generated NOT
   */
  @Override
  public String getText(Object object) {
    TracingConfiguration tracingConfiguration = (TracingConfiguration) object;
    return getString("_UI_TracingConfiguration_type") + " "
        + tracingConfiguration.getLinkType();
  }
View Full Code Here

      targetSpecObject = ((SpecHierarchy) target).getObject();
    }
    if (targetSpecObject == null)
      return null;
   
    TracingConfiguration config = (TracingConfiguration) getTarget();

    // Check whether at least one SysML Model Element is here.
    Set<EObject> elements = new HashSet<EObject>();
    for (Object object : source) {
      EObject element = null;
      if (object instanceof EObject) {
        element = (EObject) object;
      }

      if (element == null) {
        if (object instanceof IAdaptable) {
          element = (EObject) ((IAdaptable) object)
              .getAdapter(EObject.class);
        }
      }

      if (element == null) {
        continue;
      }

      // Look at the package to decide which elements we process.
      if (element.getClass().getName()
          .startsWith(config.getPackagePrefix())) {
        elements.add(element);
      }
    }

    // No appropriate element in source
View Full Code Here

  /**
   * Triggered, when an observed resource is saved.
   */
  private void scanForChanges(EditingDomain domain) {
    TracingConfiguration config = (TracingConfiguration) getTarget();
    if (config == null) {
      return;
    }

    for (SpecObject obj : ReqIF10Util.getReqIF(config).getCoreContent().getSpecObjects()) {
      if (obj.getType() == config.getProxyType()) {
        AttributeValue av = ReqIF10Util.getAttributeValue(obj,
            config.getProxyAttribute());
        if (! (av instanceof AttributeValueString)) continue;
       
        EObject element = getElementFromUri(getUrlFromProxy(obj), domain);
        updateProxyIfNecessary((AttributeValueString)av, element, domain);
      }
View Full Code Here

      }
    }
  }

  String getUrlFromProxy(SpecObject proxy) {
    TracingConfiguration config = (TracingConfiguration) getTarget();
    AttributeValue av = ReqIF10Util.getAttributeValue(proxy, config.getProxyAttribute());
    if (av instanceof AttributeValueString) {
      return getProxyUrlFromValue(((AttributeValueString)av).getTheValue());
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.openetcs.pror.tracing.TracingConfiguration

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.