Package org.emftrace.metamodel.EMFfitModel

Examples of org.emftrace.metamodel.EMFfitModel.Term


  protected FTICPackage fTICPackage;


  protected Hypertext createTestHypertext(){
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
   
    term1.setVisibleContent("foo ");
    link1.setVisibleContent("link");
    term2.setVisibleContent(" bar");
   
   
   
     hypertext.getContent().add(term1);
     hypertext.getContent().add(link1);
View Full Code Here


  } catch (Exception e) {
    e.printStackTrace();
    return;
  }
 
    Term term = (Term) textElement;
    String str = term.getVisibleContent();

    // index of the term
    int termIndex = hypertext.getContent().indexOf(term);
   
   
    int offsetAtTextElement =  HypertextHelpers.findTextElementOffsetAtTextOffset(hypertext, offset, textElement );
    String term1VisibleContent = str.substring(0, offsetAtTextElement);
    //String linkVisibleContent = str.substring(offsetAtTextElement,
    //    offsetAtTextElement + length);
    String term2VisibleContent = str.substring(offsetAtTextElement + length,
        str.length());
   
   
    if ((term1VisibleContent.length() == 0 ) && (term2VisibleContent.length() == 0)){// [term] -> [link]
      hypertext.getContent().add(termIndex + 1, createLink(linkVisibleContent, target));
      term.delete();
    } else if (term1VisibleContent.length() == 0){ // [term] -> [link, term]
      hypertext.getContent().add(termIndex, createLink(linkVisibleContent, target));
      term.setVisibleContent(term2VisibleContent);
    }else if (term2VisibleContent.length() == 0){ // [term] -> [term, link]
      term.setVisibleContent(term1VisibleContent);
      hypertext.getContent().add(termIndex+1, createLink(linkVisibleContent, target));
    } else { // [term] -> [term, link, term]
     
      term.setVisibleContent(term1VisibleContent);
      Term newTerm = EMFfitModelFactory.eINSTANCE.createTerm();
      hypertext.getContent().add(termIndex+1, createLink(linkVisibleContent, target));
      newTerm.setVisibleContent(term2VisibleContent);
      hypertext.getContent().add(termIndex + 2, newTerm);
     
    }
  }
View Full Code Here

      }
    if (index == hypertext.getContent().size() - 1 && count <= offset) {
      index = index + 1;
    }
    Term newTerm = EMFfitModelFactory.eINSTANCE.createTerm();
    newTerm.setVisibleContent(text);
    hypertext.getContent().add(index, newTerm);

  }
View Full Code Here

  public void testDoRun() {
    //setup
    String content = "foo bar";
   
    Hypertext newChangeability = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(content);
    newChangeability.getContent().add(term);
   
    Factor factor = (Factor)((FactorCategory)factorTable.getEntries().get(1)).getChildren().get(0);
   
    //run command
View Full Code Here

  public void testDoRunForNullChangeability() {
    //setup
    String content = "foo bar";
   
    Hypertext newChangeability = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(content);
    newChangeability.getContent().add(term);
   
    Factor factor = (Factor)((FactorCategory)factorTable.getEntries().get(1)).getChildren().get(0);
    factor.setChangeability(null);
   
View Full Code Here

  public void testDoRun() {
    //setup
    String content = "foo bar";
   
    Hypertext newDescription = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(content);
    newDescription.getContent().add(term);
 
   
    //run command
    new UpdateIssueCardDescriptionCommand(issueCard, newDescription).runWithoutUnicaseCommand();
View Full Code Here

  public void testDoRunForNullDescription() {
    //setup
    String content = "foo bar";
   
    Hypertext newDescription= EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(content);
    newDescription.getContent().add(term);
   
    issueCard.setDescription(null);
   
    //run command
View Full Code Here

  public void testDoRun() {
    //setup for old hypertext element
    Hypertext oldHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    String oldHypertextIdentifier = oldHypertext.getIdentifier();

    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    term1.setVisibleContent("term1 ");

    String term1Identifier = term1.getIdentifier();

    Link link = EMFfitModelFactory.eINSTANCE.createLink();
    link.setVisibleContent("link1");
    Factor linkedFactor = EMFfitModelFactory.eINSTANCE.createFactor();
    link.setTarget(linkedFactor);
    String linkIdentifier = link.getIdentifier();

    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
    term2.setVisibleContent(" term2");
    String term2Identifier = term2.getIdentifier();

    oldHypertext.getContent().add(term1);
    oldHypertext.getContent().add(link);
    oldHypertext.getContent().add(term2);

    //setup for new changed hypertext element
    String newTerm1Content = "xxxterm1xxx xxx ";
    String newLinkContent = "newlink";
    String newTerm2Content = "xxxterm2xxx xxx";

    Hypertext newHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();

    Term newTerm1 = EMFfitModelFactory.eINSTANCE.createTerm();
    newTerm1.setVisibleContent(newTerm1Content);

    Link newLink = EMFfitModelFactory.eINSTANCE.createLink();
    newLink.setVisibleContent(newLinkContent);
    Factor newLinkedFactor = EMFfitModelFactory.eINSTANCE.createFactor();
    newLink.setTarget(newLinkedFactor);

    Term newterm2 = EMFfitModelFactory.eINSTANCE.createTerm();
    newterm2.setVisibleContent(newTerm2Content);

    newHypertext.getContent().add(newTerm1);
    newHypertext.getContent().add(newLink);
    newHypertext.getContent().add(newterm2);
   
View Full Code Here

    Hypertext oldEmptyHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    String oldEmptyHypertextIdentifier = oldEmptyHypertext.getIdentifier();
    Hypertext newHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();

   
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(newTermContent);
   
    newHypertext.getContent().add(term);

    //run command
    new UpdateHypertextContentsCommand(oldEmptyHypertext, newHypertext)
View Full Code Here

     //setup
    String newTermContent = "foo";

    Hypertext oldHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    String oldHypertextIdentifier = oldHypertext.getIdentifier();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(newTermContent);
    oldHypertext.getContent().add(term);
   
    Hypertext newEmptyHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();

        //run command
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.EMFfitModel.Term

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.