Package org.emftrace.metamodel.EMFfitModel

Examples of org.emftrace.metamodel.EMFfitModel.Term


 
  // tests add a term behind a link at text end
  @Test
  public void testDoRunForAppend() {
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
   
    term1.setVisibleContent("foo ");
    link1.setVisibleContent("link");
   
    hypertext.getContent().add(term1);
    hypertext.getContent().add(link1);
   
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);
   
    Factor factor = (Factor)((FactorCategory)factorTable.getEntries().get(1)).getChildren().get(0);
   
    //run command
View Full Code Here

  @Test
  public void testDoRunForPrepend() {
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();

    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
   
   
    link1.setVisibleContent("link");
    term1.setVisibleContent(" foo");

    hypertext.getContent().add(link1);
    hypertext.getContent().add(term1);
   
    new AddHypertextTermCommand(hypertext, 0, "").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);
   
    Factor factor = (Factor)((FactorCategory)factorTable.getEntries().get(1)).getChildren().get(0);
    factor.setDescription(null);
   
View Full Code Here

 
  @Test
  public void testDoRunForTermLink_Term_LinkTerm() {
   
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link2 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term3 = EMFfitModelFactory.eINSTANCE.createTerm();
   
    term1.setVisibleContent("foo ");
    link1.setVisibleContent("link1");
    term2.setVisibleContent("x");
    link2.setVisibleContent("link2");
    term3.setVisibleContent(" bar");
   
    hypertext.getContent().add(term1);
    hypertext.getContent().add(link1);
    hypertext.getContent().add(term2);
    hypertext.getContent().add(link2);
View Full Code Here

 
  @Test
  public void testDoRunForTermLink_Term_Link_Term() {
   
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link2 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term3 = EMFfitModelFactory.eINSTANCE.createTerm();
   
    term1.setVisibleContent("foo ");
    link1.setVisibleContent("link1");
    term2.setVisibleContent(" bar ");
    link2.setVisibleContent("link2");
    term3.setVisibleContent(" thing");
   
    hypertext.getContent().add(term1);
    hypertext.getContent().add(link1);
    hypertext.getContent().add(term2);
    hypertext.getContent().add(link2);
View Full Code Here

 
  @Test
  public void testDoRunForTermLink_Link_LinkTerm() {
   
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    Link link2 = EMFfitModelFactory.eINSTANCE.createLink();
    Link link3 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
   
    term1.setVisibleContent("foo ");
    link1.setVisibleContent("link1");
    link2.setVisibleContent("link2");
    link3.setVisibleContent("link3");
    term2.setVisibleContent(" bar");
   
    hypertext.getContent().add(term1);
    hypertext.getContent().add(link1);
    hypertext.getContent().add(link2);
    hypertext.getContent().add(link3);
View Full Code Here

    project.addModelElement(hyperText);
  }
 
  @Test
  public void testDoRunForTermLinkTerm() {
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    term1.setVisibleContent("foo ");
    hyperText.getContent().add(term1);
   
    Factor target = EMFfitModelFactory.eINSTANCE.createFactor();
    Link link = EMFfitModelFactory.eINSTANCE.createLink();
    link.setVisibleContent("link");
    link.setTarget(target);
    hyperText.getContent().add(link);
   
    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
    term2.setVisibleContent(" bar");
    hyperText.getContent().add(term2);
   
    new DoHypertextUnlinkWordCommand(hyperText, link).runWithoutUnicaseCommand();
   
    assertEquals(1, hyperText.getContent().size());
View Full Code Here

    assertEquals("foo link bar", ((Term) hyperText.getContent().get(0)).getVisibleContent());
  }
 
  @Test
  public void testDoRunForTermLinkLinkTerm1() {
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    term1.setVisibleContent("foo ");
    hyperText.getContent().add(term1);
   
    Factor target1 = EMFfitModelFactory.eINSTANCE.createFactor();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    link1.setVisibleContent("link1");
    link1.setTarget(target1);
    hyperText.getContent().add(link1);
   
    Factor target2 = EMFfitModelFactory.eINSTANCE.createFactor();
    Link link2 = EMFfitModelFactory.eINSTANCE.createLink();
    link2.setVisibleContent("link2");
    link2.setTarget(target2);
    hyperText.getContent().add(link2);
   
    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
    term2.setVisibleContent(" bar");
    hyperText.getContent().add(term2);
   
    new DoHypertextUnlinkWordCommand(hyperText, link1).runWithoutUnicaseCommand();
   
    assertEquals(3, hyperText.getContent().size());
View Full Code Here

    assertEquals(" bar", ((Term) hyperText.getContent().get(2)).getVisibleContent());
  }
 
  @Test
  public void testDoRunForTermLinkLinkTerm2() {
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    term1.setVisibleContent("foo ");
    hyperText.getContent().add(term1);
   
    Factor target1 = EMFfitModelFactory.eINSTANCE.createFactor();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    link1.setVisibleContent("link1");
    link1.setTarget(target1);
    hyperText.getContent().add(link1);
   
    Factor target2 = EMFfitModelFactory.eINSTANCE.createFactor();
    Link link2 = EMFfitModelFactory.eINSTANCE.createLink();
    link2.setVisibleContent("link2");
    link2.setTarget(target2);
    hyperText.getContent().add(link2);
   
    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
    term2.setVisibleContent(" bar");
    hyperText.getContent().add(term2);
   
    new DoHypertextUnlinkWordCommand(hyperText, link2).runWithoutUnicaseCommand();
   
    assertEquals(3, hyperText.getContent().size());
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.