Package org.eclipse.rmf.reqif10

Examples of org.eclipse.rmf.reqif10.AttributeValue


  @Test
  public void testUpdateProxyIfNecessaryExternalChanged() throws Exception {
    CreateTraceCommand cmd = createCommand();
    editingDomain.getCommandStack().execute(cmd);
    SpecObject proxy = cmd.findProxyFor(external);
   
    TracingConfigurationItemProvider ip = (TracingConfigurationItemProvider) ProrUtil
        .getItemProvider(adapterFactory, config);
    ((ReqIFHeader)external).setComment("A comment");
    AttributeValueString value = (AttributeValueString) proxy.getValues().get(0);
    ip.updateProxyIfNecessary(value, external, editingDomain);
   
    // Ensure the values match
    assertEquals(value.getTheValue(), ip.buildProxyContent(external));
  }
View Full Code Here


   * Adds to the provided compound command to create a link from a proxy for
   * element to the drop target. If a proxy already exists, it is reused. If a
   * link of the correct type already exists, it is reused as well.
   */
  void createCreateLinkCommand(CompoundCommand cmd, EObject element) {
    SpecObject proxy = getProxy(element, cmd);
    SpecRelation specRelation = getLink(proxy, cmd);
    TracingUtil.notifyProxyListeners(target, specRelation, element);
  }
View Full Code Here

  /**
   * Returns the proxy for the given element.  If the proxy does not exist yet,
   * it is created, thereby appending to cmd.
   */
  private SpecObject getProxy(EObject element, CompoundCommand cmd) {
    SpecObject proxy = findProxyFor(element);
    if (proxy == null)
      proxy = createProxy(cmd, element);
    return proxy;
  }
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.
View Full Code Here

    }
    return null;
  }

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

   */
  public Command handleDragAndDrop(Collection<?> source, Object target,
      EditingDomain editingDomain, int operation) {

    // Only support SpecHierarchies and SpecObjects as targets.
    SpecObject targetSpecObject = null;
    if (target instanceof SpecObject) {
      targetSpecObject = (SpecObject) target;
    } else if (target instanceof SpecHierarchy) {
      targetSpecObject = ((SpecHierarchy) target).getObject();
    }
View Full Code Here

    // Build the Datatypes
    DatatypeDefinitionString t_string = rf.createDatatypeDefinitionString();
    content.getDatatypes().add(t_string);
   
    // Build SpecObject Type for requirements.
    SpecObjectType requirementType = rf.createSpecObjectType();
    AttributeDefinitionString ad_requirement = rf.createAttributeDefinitionString();
    ad_requirement.setType(t_string);
    requirementType.getSpecAttributes().add(ad_requirement);
    content.getSpecTypes().add(requirementType);
   
    // Build SpecObject Type for proxy.
    SpecObjectType proxyType = rf.createSpecObjectType();
    AttributeDefinitionString ad_proxy = rf.createAttributeDefinitionString();
    ad_proxy.setType(t_string);
    proxyType.getSpecAttributes().add(ad_proxy);
    content.getSpecTypes().add(proxyType);
   
    // Build SpecRelationType for linking
    SpecRelationType linkType = rf.createSpecRelationType();
    content.getSpecTypes().add(linkType);
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setProxyType(SpecObjectType newProxyType) {
    SpecObjectType oldProxyType = proxyType;
    proxyType = newProxyType;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, TracingPackage.TRACING_CONFIGURATION__PROXY_TYPE, oldProxyType, proxyType));
  }
View Full Code Here

   * element to the drop target. If a proxy already exists, it is reused. If a
   * link of the correct type already exists, it is reused as well.
   */
  void createCreateLinkCommand(CompoundCommand cmd, EObject element) {
    SpecObject proxy = getProxy(element, cmd);
    SpecRelation specRelation = getLink(proxy, cmd);
    TracingUtil.notifyProxyListeners(target, specRelation, element);
  }
View Full Code Here

   * Returns the link for the given link.  If the link does not exist yet,
   * it is created, thereby appending to cmd.
   * @param element
   */
  private SpecRelation getLink(SpecObject proxy, CompoundCommand cmd) {
    SpecRelation link = findLinkFor(proxy);
    if (link == null)
      link = createLink(cmd, proxy);
    return link;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.rmf.reqif10.AttributeValue

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.