Package org.eclipse.rmf.reqif10

Examples of org.eclipse.rmf.reqif10.SpecRelationType


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



  public static String getCellString(Object value, boolean html) {
    if (!(value instanceof AttributeValueString))
      return "ERROR: Not a String Attribute: " + value;
    AttributeValueString av = (AttributeValueString) value;
    StringTokenizer st = new StringTokenizer(av.getTheValue(), "\n\r");
    if (!st.hasMoreTokens()) return "ERROR: No Content: " + value;
    st.nextToken();
    StringBuilder result = new StringBuilder();
    while (st.hasMoreTokens()) {
      result.append(st.nextToken());
View Full Code Here

      final SpecObject object, AttributeDefinition ad,
      final EList<String> names) {
    AttributeValue av = ReqIF10Util.getAttributeValue(object, ad);
    if (!(av instanceof AttributeValueString))
      return;
    final AttributeValueString value = (AttributeValueString) av;

    final EObject target = getElementFromProxy(getProxyUrlFromValue(value
        .getTheValue()));
    System.out.println("Registering with: " + target.eResource());
    target.eResource().eAdapters().add(new AdapterImpl() {
      @Override
      public void notifyChanged(Notification notification) {
        System.out.println("Changed.");
        String newContent = TracingUtil.createProxyContent(
            (EObject) target, names);
        if (!newContent.equals(value.getTheValue())) {
          Command cmd = SetCommand
              .create(domain,
                  object,
                  ReqIF10Package.Literals.SPEC_ELEMENT_WITH_ATTRIBUTES__VALUES,
                  newContent);
View Full Code Here

    ReqIF reqif = rf.createReqIF();
    ReqIFContent content = rf.createReqIFContent();
    reqif.setCoreContent(content);
   
    // 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();
View Full Code Here

  }

  private ReqIF buildTestReqif() throws IOException {
    ReqIF10Factory rf = ReqIF10Factory.eINSTANCE;
    ConfigurationFactory cf = ConfigurationFactory.eINSTANCE;
    ReqIF reqif = rf.createReqIF();
    ReqIFContent content = rf.createReqIFContent();
    reqif.setCoreContent(content);
   
    // Build the Datatypes
    DatatypeDefinitionString t_string = rf.createDatatypeDefinitionString();
    content.getDatatypes().add(t_string);
   
View Full Code Here

  /**
   * The external element (to be traced from/to) must be persisted.  For simplicity, we use
   * a ReqIF model.
   */
  private EObject buildTestExternal() throws IOException {
    ReqIF reqif  = ReqIF10Factory.eINSTANCE.createReqIF();
    ReqIFHeader header= ReqIF10Factory.eINSTANCE.createReqIFHeader();
    header.setTitle("HeaderTitle");
    reqif.setTheHeader(header);
    external = header;
   
    File file = File.createTempFile("tracing-test-", ".reqif");
    file.deleteOnExit();
    URI uri = URI.createFileURI(file.getAbsolutePath());
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);
      if (value instanceof AttributeValueString) {
        String tmpUrl = TracingConfigurationItemProvider
            .getProxyUrlFromValue(((AttributeValueString) value)
View Full Code Here

    }
   
  }

  private ReqIF buildTestReqif() throws IOException {
    ReqIF10Factory rf = ReqIF10Factory.eINSTANCE;
    ConfigurationFactory cf = ConfigurationFactory.eINSTANCE;
    ReqIF reqif = rf.createReqIF();
    ReqIFContent content = rf.createReqIFContent();
    reqif.setCoreContent(content);
   
    // 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);

    // Add the Config Element
    ProrToolExtension toolExtension = cf.createProrToolExtension();
    ReqIFToolExtensionUtil.addToolExtension(reqif, toolExtension);
    ProrPresentationConfigurations presentationConfigs = cf.createProrPresentationConfigurations();
    toolExtension.setPresentationConfigurations(presentationConfigs);
    config = TracingFactory.eINSTANCE.createTracingConfiguration();
   
    // Configure the Config Element
    presentationConfigs.getPresentationConfigurations().add(config);
    config.setDatatype(t_string);
    config.setLinkType(linkType);
    config.setProxyAttribute(ad_proxy);
    config.setProxyType(proxyType);
   
    requirement = rf.createSpecObject();
    requirement.setType(requirementType);
    content.getSpecObjects().add(requirement);
    return reqif;
  }
View Full Code Here

    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Obtain other dependent packages
    ConfigurationPackage theConfigurationPackage = (ConfigurationPackage)EPackage.Registry.INSTANCE.getEPackage(ConfigurationPackage.eNS_URI);
    ReqIF10Package theReqIF10Package = (ReqIF10Package)EPackage.Registry.INSTANCE.getEPackage(ReqIF10Package.eNS_URI);
    XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes
    tracingConfigurationEClass.getESuperTypes().add(theConfigurationPackage.getProrPresentationConfiguration());

    // Initialize classes and features; add operations and parameters
    initEClass(tracingConfigurationEClass, TracingConfiguration.class, "TracingConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getTracingConfiguration_ProxyType(), theReqIF10Package.getSpecObjectType(), null, "proxyType", null, 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getTracingConfiguration_ProxyAttribute(), theReqIF10Package.getAttributeDefinitionString(), null, "proxyAttribute", null, 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getTracingConfiguration_AttributeNames(), theXMLTypePackage.getString(), "attributeNames", null, 0, -1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getTracingConfiguration_LinkFromTarget(), ecorePackage.getEBoolean(), "linkFromTarget", "true", 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getTracingConfiguration_LinkType(), theReqIF10Package.getSpecRelationType(), null, "linkType", null, 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getTracingConfiguration_PackagePrefix(), theXMLTypePackage.getString(), "packagePrefix", "org.eclipse.uml", 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    // Create resource
    createResource(eNS_URI);
  }
View Full Code Here

  private ReqIF buildTestReqif() throws IOException {
    ReqIF10Factory rf = ReqIF10Factory.eINSTANCE;
    ConfigurationFactory cf = ConfigurationFactory.eINSTANCE;
    ReqIF reqif = rf.createReqIF();
    ReqIFContent content = rf.createReqIFContent();
    reqif.setCoreContent(content);
   
    // 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);

    // Add the Config Element
    ProrToolExtension toolExtension = cf.createProrToolExtension();
    ReqIFToolExtensionUtil.addToolExtension(reqif, toolExtension);
    ProrPresentationConfigurations presentationConfigs = cf.createProrPresentationConfigurations();
    toolExtension.setPresentationConfigurations(presentationConfigs);
    config = TracingFactory.eINSTANCE.createTracingConfiguration();
   
    // Configure the Config Element
    presentationConfigs.getPresentationConfigurations().add(config);
    config.setDatatype(t_string);
    config.setLinkType(linkType);
    config.setProxyAttribute(ad_proxy);
    config.setProxyType(proxyType);
   
    requirement = rf.createSpecObject();
    requirement.setType(requirementType);
    content.getSpecObjects().add(requirement);
    return reqif;
  }
View Full Code Here

TOP

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

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.