Package org.emftrace.emffit.ui.commands.factortables

Examples of org.emftrace.emffit.ui.commands.factortables.RepairFactorTableFTEntriesNumberingsCommand


    entry.delete();
    //rebuild numberings
        if (parentElement instanceof FTEntry){
          new RepairFTEntryNumberingCommand((FTEntry) parentElement, ((FTEntry) parentElement).getNumbering(),false).runWithoutUnicaseCommand();
    } else if (parentElement instanceof FactorTable){
          new RepairFactorTableFTEntriesNumberingsCommand((FactorTable)parentElement, false).runWithoutUnicaseCommand();   
    }
    }
View Full Code Here


   */
  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
   
    final FactorTable factorTable = (FactorTable) UiUtil.getSelectedEObject();
    new RepairFactorTableFTEntriesNumberingsCommand(factorTable, true).runAsJob();
    return null;
  }
View Full Code Here

    FactorCategory category2nd = (FactorCategory)factorTable.getEntries().get(1);
    category2nd.setNumbering("O5");
    category2nd.getChildren().get(0).setNumbering("O5.1");
   
   
    new RepairFactorTableFTEntriesNumberingsCommand(factorTable,false).runWithoutUnicaseCommand();
   
    assertEquals("O1", category1st.getNumbering());
    assertEquals("O1.1", category1st.getChildren().get(0).getNumbering());
    assertEquals("O1.1.1", ((FactorCategory)category1st.getChildren().get(0)).getChildren().get(0).getNumbering());
    assertEquals("O1.2", category1st.getChildren().get(1).getNumbering());
    assertEquals("O1.3", category1st.getChildren().get(2).getNumbering());
    assertEquals("O1.4", category1st.getChildren().get(3).getNumbering());
   
    assertEquals("O2", category2nd.getNumbering());
    assertEquals("O2.1", category2nd.getChildren().get(0).getNumbering());
   
   
    //don't rebuild invalid numberings if parent items has a valid numbering
    new RepairFactorTableFTEntriesNumberingsCommand(factorTable,false).runWithoutUnicaseCommand();
    ((FactorCategory) category1st.getChildren().get(0)).getChildren().get(0).setNumbering("O2.1.1");
    assertEquals("O2.1.1", ((FactorCategory)category1st.getChildren().get(0)).getChildren().get(0).getNumbering());
   
   
  }
View Full Code Here

    FactorCategory category2nd = (FactorCategory)factorTable.getEntries().get(1);
    category2nd.setNumbering("O5");
    category2nd.getChildren().get(0).setNumbering("O5.1");
   
   
    new RepairFactorTableFTEntriesNumberingsCommand(factorTable,false).runWithoutUnicaseCommand();
   
    assertEquals("O1", category1st.getNumbering());
    assertEquals("O1.1", category1st.getChildren().get(0).getNumbering());
    assertEquals("O1.1.1", ((FactorCategory)category1st.getChildren().get(0)).getChildren().get(0).getNumbering());
    assertEquals("O1.2", category1st.getChildren().get(1).getNumbering());
    assertEquals("O1.3", category1st.getChildren().get(2).getNumbering());
    assertEquals("O1.4", category1st.getChildren().get(3).getNumbering());
   
    assertEquals("O2", category2nd.getNumbering());
    assertEquals("O2.1", category2nd.getChildren().get(0).getNumbering());
   
   
    //rebuild invalid numberings of any FTEntry
    ((FactorCategory) category1st.getChildren().get(0)).getChildren().get(0).setNumbering("O2.1.1");
    new RepairFactorTableFTEntriesNumberingsCommand(factorTable,true).runWithoutUnicaseCommand();

    assertEquals("O1.1.1", ((FactorCategory)category1st.getChildren().get(0)).getChildren().get(0).getNumbering());
   
   
   
View Full Code Here

TOP

Related Classes of org.emftrace.emffit.ui.commands.factortables.RepairFactorTableFTEntriesNumberingsCommand

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.