Package org.eclipse.rmf.reqif10

Examples of org.eclipse.rmf.reqif10.AttributeValue


   * @param object
   */
  public static void registerProxyListener(final EditingDomain domain,
      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
View Full Code Here


      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

    SpecObject proxy = cmd.findProxyFor(external);
    TracingConfigurationItemProvider ip = (TracingConfigurationItemProvider) ProrUtil
        .getItemProvider(adapterFactory, config);

   
    AttributeValueString value = ((AttributeValueString)proxy.getValues().get(0));
    ip.updateProxyIfNecessary(value, external, editingDomain);
    // No Cmd should be triggered from this
    assertEquals(cmd, editingDomain.getCommandStack().getMostRecentCommand());
  }
View Full Code Here

    editingDomain.getCommandStack().execute(cmd);
    SpecObject proxy = cmd.findProxyFor(external);
   
    TracingConfigurationItemProvider ip = (TracingConfigurationItemProvider) ProrUtil
        .getItemProvider(adapterFactory, config);
    AttributeValueString value = ((AttributeValueString)proxy.getValues().get(0));
    value.setTheValue(value.getTheValue() + "x");
    ip.updateProxyIfNecessary(value, external, editingDomain);
   
    // Ensure the values match
    assertEquals(value.getTheValue(), ip.buildProxyContent(external));
  }
View Full Code Here

    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

  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

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.