Examples of Hypertext


Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  }
 
  // tests add a term before a link at text start
  @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();
   
    assertEquals(3, hypertext.getContent().size());
   
    assertTrue(hypertext.getContent().get(0) instanceof Term);
    assertEquals(link1, hypertext.getContent().get(1));
    assertEquals(term1, hypertext.getContent().get(2));

   
  }
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  @Test
  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
    new UpdateFactorDescriptionCommand(factor,newDescription ).runWithoutUnicaseCommand();
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  @Test
  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);
   
    //run command
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  }
 
  @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);
    hypertext.getContent().add(term3);
   
    project.addModelElement(hypertext);
   
   
    new DeleteHypertextTextElementCommand(hypertext,5).runWithoutUnicaseCommand();
    assertEquals(4, hypertext.getContent().size());
    assertEquals("foo ", hypertext.getContent().get(0).getVisibleContent());
    assertEquals("link1", hypertext.getContent().get(1).getVisibleContent());
    assertEquals("link2", hypertext.getContent().get(2).getVisibleContent());
    assertEquals(" bar", hypertext.getContent().get(3).getVisibleContent());
  }
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  }
 
  @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);
    hypertext.getContent().add(term3);
   
    project.addModelElement(hypertext);
   
   
    new DeleteHypertextTextElementCommand(hypertext, 10).runWithoutUnicaseCommand();
    assertEquals(3, hypertext.getContent().size());
    assertEquals("foo ", hypertext.getContent().get(0).getVisibleContent());
    assertEquals("link1", hypertext.getContent().get(1).getVisibleContent());
    assertEquals(link1, hypertext.getContent().get(1));
    assertTrue(hypertext.getContent().get(1) instanceof Link);
    assertEquals(" bar  thing", hypertext.getContent().get(2).getVisibleContent());
    assertTrue(hypertext.getContent().get(2) instanceof Term);
  }
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  }
 
  @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);
    hypertext.getContent().add(term2);
   
    project.addModelElement(hypertext);
   
   
    new DeleteHypertextTextElementCommand(hypertext,5).runWithoutUnicaseCommand();
    assertEquals(4, hypertext.getContent().size());
    assertEquals("foo ", hypertext.getContent().get(0).getVisibleContent());
    assertEquals("link1", hypertext.getContent().get(1).getVisibleContent());
    assertEquals("link3", hypertext.getContent().get(2).getVisibleContent());
    assertEquals(" bar", hypertext.getContent().get(3).getVisibleContent());
  }
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  @Test
  public void testDoRun() {
   
    //setup
    InfluencingFactor influencingFactor = issueCard.getInfluencingFactors().get(0);
    Hypertext newDescription = EMFfitModelFactory.eINSTANCE.createHypertext();
   
    String newDescriptionContent = "new foo";
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(newDescriptionContent);
    newDescription.getContent().add(term);
   
    //run command
    new UpdateInfluencingFactorDescriptionCommand(influencingFactor, newDescription).runWithoutUnicaseCommand();
   
    //check
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

   
    //setup
    InfluencingFactor influencingFactor = issueCard.getInfluencingFactors().get(0);
    influencingFactor.setDescription(null);
   
    Hypertext newDescription = EMFfitModelFactory.eINSTANCE.createHypertext();
   
    String newDescriptionContent = "new foo";
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(newDescriptionContent);
    newDescription.getContent().add(term);
   
    //run command
    new UpdateInfluencingFactorDescriptionCommand(influencingFactor, newDescription).runWithoutUnicaseCommand();
   
    //check
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

   * @see emffit_commands.EMFfitCommand#doRun()
   */
  @Override
  protected void doRun() {

    Hypertext currentDescription = influencingFactor.getDescription();
    if (currentDescription == null) {
      currentDescription = EMFfitModelFactory.eINSTANCE.createHypertext();
      influencingFactor.setDescription(currentDescription);
    }
    new UpdateHypertextContentsCommand(currentDescription, newDescription)
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

public class HypertextHelpersTest extends EMFfitTestCase {
 
  @Test
  public void testFindTextElementAtOffset(){

    Hypertext hypertext = createTestHypertext();
   
    TextElement result = HypertextHelpers.findTextElementAtOffset(hypertext, 4);
    assertNotNull(result);
    assertTrue(result instanceof Link);
    assertEquals("link", result.getVisibleContent());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.