Package org.emftrace.metamodel.EMFfitModel

Examples of org.emftrace.metamodel.EMFfitModel.Factor


  private Image image;
 
  public void setUp() throws Exception {
    super.setUp();
    project.getAllModelElements().clear();
    Factor f = EMFfitModelFactory.eINSTANCE.createFactor();
    f.setName("foo");
    modelElement = f;
    id = f.getIdentifier();
    content = new HashMap<String, String>();
    content.put("Name", f.getName());
    label = "P1.2 "+f.getName();
    image = new Image(Display.getDefault(), 3,3);
    item = new ContentProviderResultItem(id, modelElement, label, image, content, project);
 
View Full Code Here


  }
 
  @Test
  public void testCompareTo() {
   
    Factor equalFactor = EMFfitModelFactory.eINSTANCE.createFactor();
    equalFactor.setName("foo");
    HashMap<String, String> equalFactorContent = new HashMap<String, String>();
    equalFactorContent.put("name", "foo");
    ContentProviderResultItem equalItem = new ContentProviderResultItem(equalFactor.getIdentifier(), equalFactor,"P1.2 " + equalFactor.getName(), null, equalFactorContent,  project);
   
    HashMap<String, String> belowFactorContent = new HashMap<String, String>();
    belowFactorContent.put("name", "foa");
    Factor belowFactor = EMFfitModelFactory.eINSTANCE.createFactor();
    belowFactor.setName("foa");
    ContentProviderResultItem belowItem = new ContentProviderResultItem(belowFactor.getIdentifier(), belowFactor, "P1.1 " + belowFactor.getName(), null, belowFactorContent, project);
   
    HashMap<String, String> aboveFactorContent = new HashMap<String, String>();
    aboveFactorContent.put("name", "foz");
    Factor aboveFactor = EMFfitModelFactory.eINSTANCE.createFactor();
    aboveFactor.setName("foz");
    ContentProviderResultItem aboveItem = new ContentProviderResultItem(aboveFactor.getIdentifier(), aboveFactor, "P1.3 " + aboveFactor.getName(), null, aboveFactorContent, project);
   
    assertTrue(item.compareTo(aboveItem) < 0);
    assertEquals(0, item.compareTo(equalItem));
    assertTrue(item.compareTo(belowItem) > 0);
   
   
    //test with null values
    Factor nullFactor = EMFfitModelFactory.eINSTANCE.createFactor();
    ContentProviderResultItem nullItem = new ContentProviderResultItem(nullFactor.getIdentifier(), nullFactor,  nullFactor.getName(), null, null, null);
   
   
    assertTrue(item.compareTo(nullItem) > 0);
    assertTrue(nullItem.compareTo(item) < 0);
View Full Code Here

   */
  @Override
  protected void setInfluencingFactorsItemPartValues(

  InfluencingFactor influencingFactor, final ListItemPart part) {
    Factor factor = influencingFactor.getFactor();
    setInfluencingFactorHeader(factor, part);

    part.setText(influencingFactor.getDescription());

    part
View Full Code Here

    super.tearDown();
  }

  @Test
  public void testRun() {
    Factor factor1 = EMFfitModelFactory.eINSTANCE.createFactor();

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

    Hypertext hypertext1 = EMFfitModelFactory.eINSTANCE.createHypertext();
    hypertext1.getContent().add(term1);

    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
    term2.setVisibleContent("bar");

    Hypertext hypertext2 = EMFfitModelFactory.eINSTANCE.createHypertext();
    hypertext2.getContent().add(term2);

    factor1.setDescription(hypertext1);
    factor1.setFlexibility(hypertext2);

    Factor factor2 = EMFfitModelFactory.eINSTANCE.createFactor();
    Factor factor3 = EMFfitModelFactory.eINSTANCE.createFactor();
    Factor factor4 = EMFfitModelFactory.eINSTANCE.createFactor();

    factor1.setName("foo factor 1");
    factor1.setNumbering("P1.1.3");
    factor2.setName("foo factor 2");
    factor3.setName("foo factor 3");
View Full Code Here

  private FilteredContentProviderResultItem item;
 
  public void setUp() throws Exception {
    super.setUp();
    project.getAllModelElements().clear();
    Factor f = EMFfitModelFactory.eINSTANCE.createFactor();
    f.setName("foo fuu bar");
    modelElement = f;
    id = f.getIdentifier();
    label = "P1.2 "+f.getName();
    HashMap<String, String> content = new HashMap<String, String>();
    content.put("Name", f.getName());
   
    HashMap<String, List<String> > hits = new HashMap<String, List<String> > ();
    List<String> nameHits = new ArrayList<String>();
    nameHits.add("foo");
    nameHits.add("fuu");
View Full Code Here

  /* (non-Javadoc)
   * @see emffit_commands.EMFfitCommand#doRun()
   */
  @Override
  protected void doRun() {
    Factor factor = EMFfitModelFactory.eINSTANCE.createFactor();
    factor.setName(name);   
    factor.setPriority(priority);
    factor.setNumbering(entry.getNumbering()+"."+new Integer(entry.getChildren().size()+1).toString());
    entry.getChildren().add(factor);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see emffit_commands.EMFfitCommand#doRun()
   */
  @Override
  protected void doRun() {
    Factor newFactor= EMFfitModelFactory.eINSTANCE.createFactor();
    newFactor.setName(name);
   
        String number = FTHelpers.getFactorTableNumbering(factorTable);
        newFactor.setNumbering(number + new Integer(factorTable.getEntries().size() + 1).toString());
       
       /* newFactor.setDescription(EMFfitFactory.eINSTANCE.createHypertext());
        newFactor.setFlexibility(EMFfitFactory.eINSTANCE.createHypertext());
        newFactor.setChangeability(EMFfitFactory.eINSTANCE.createHypertext());
        newFactor.setInfluence(EMFfitFactory.eINSTANCE.createHypertext());*/
   
        newFactor.setPriority(priority);
    factorTable.getEntries().add(newFactor);
  }
View Full Code Here

   */
  @Override
  public boolean performFinish() {
    //note: Hypertext elements must not be null
    //new element will be added to project by command
    Factor newFactor = EMFfitModelFactory.eINSTANCE.createFactor();
    newFactor.setName(newModelElementWizardPage.getName())
    newFactor.setPriority("2")

    new NewIssueCardInfluencingFactorCommand(issueCard,
        newFactor).runAsJob();
    return true;

View Full Code Here

      final InfluencingFactor influencingFactor, final ListItemPart part) {
    ModelElementChangeListener influencingFactorChangeListener = new ModelElementChangeListener() {

      @Override
      public void onChange(Notification notification) {
        Factor oldFactor = (Factor) notification.getOldValue();
        final Factor newFactor = (Factor) notification.getNewValue();

        deleteModelElementChangeListener(oldFactor);
        addFactorChangeListener(influencingFactor, part);
        Display.getDefault().asyncExec(new Runnable() {
View Full Code Here

   * @param part
   *            the Part of the InfluencingFactor
   */
  protected void addFactorChangeListener(InfluencingFactor influencingFactor,
      ListItemPart part) {
    final Factor factor = influencingFactor.getFactor();
    if (factor != null) {
      ModelElementChangeListener factorChangeListener = createInfluencingFactorFactorModelElementChangeListener(
          factor, part);
      factor.addModelElementChangeListener(factorChangeListener);
      modelElementChangeListeners.put(factorChangeListener, factor);
    }
  }
View Full Code Here

TOP

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

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.