Package org.eclipse.gmf.runtime.diagram.ui.editparts

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart


    initializeModelFile();
   
    // there should only be two children
   
    // open page
    ShapeNodeEditPart page = assertHasFrame(editor, "container");
    DiagramDocumentEditor editor_page = openDiagram(page);
    try {
      ShapeNodeEditPart form = assertHasInputForm(editor_page, "target form", false);
 
      // lets run the action
      runAction(new RefreshFormMappingsWithDrools(), form);
 
      // the current editor should still be the same
      // should have three children
      assertEditorHasChildren(3, editor_page);
      assertHasInputForm(editor_page, "target form", false);
     
      // open input form
      DiagramDocumentEditor editor_form = openDiagram(form);
      try {
        assertEditorVisual(editor_form);
       
        // no longer empty!
        // text fields in the form
        assertEditorHasChildren(6, editor_form);
        ShapeNodeEditPart a1 = assertHasInputTextField(editor_form, "attribute one", false);
        assertGenerated(a1);
        ShapeNodeEditPart a2 = assertHasInputTextField(editor_form, "attribute two", false);
        assertGenerated(a2);
        ShapeNodeEditPart a3 = assertHasInputTextField(editor_form, "attribute three", false);
        assertGenerated(a3);
   
        // attribute instances in the iterator
        ShapeNodeEditPart d1 = assertHasDomainAttributeInstance(editor_form, "attribute one", true);
        assertGenerated(d1);
        ShapeNodeEditPart d2 = assertHasDomainAttributeInstance(editor_form, "attribute two", true);
        assertGenerated(d2);
        ShapeNodeEditPart d3 = assertHasDomainAttributeInstance(editor_form, "attribute three", true);
        assertGenerated(d3);
       
        // conneced by SyncWires
        ConnectionNodeEditPart s1 = assertHasSyncWire(editor_form, a1, d1, "sync");
        assertGenerated(s1);
View Full Code Here


   
    // there should not be a page called 'outside activation'
    assertNotHasPage(editor, "created");
   
    // open page
    ShapeNodeEditPart page = assertHasFrame(editor, "target");
    editor_page = openDiagram(page);
    assertEditorFrame(editor_page);

    // there should not be a text field called 'created'
    assertNotHasInputTextField(editor_page, "created");
View Full Code Here

    {
      // there should only be two children
      assertEditorHasChildren(2, editor);
     
      // get contents
      ShapeNodeEditPart target = assertHasFrame(editor, "target");
      assertHasFrame(editor, "other");
     
      // select the first text field and infer!
      runAction(getAction(), target);
     
      // save it
      editor.doSave(new NullProgressMonitor());
     
      // nothing should be added (remember we are using
      // a custom rule set)
      assertEditorHasChildren(2, editor);
     
      // however, if we open up the text field, there should be elements
      // in here generated
      editor_page = openDiagram(target);
 
      checkPartialInferenceEditor();
     
      editor_page.close(false);
      editor_page = null;
      editor.close(false);
      editor = null;
    }
   
    // delete the target diagram
    IFile model = getProject().getFile(getModel());
    IFile modelNew = getProject().getFile("new-model.iaml");
    IFile diagramNew = getProject().getFile("new-model.iaml_diagram");
   
    // infer entire model
    inferSourceModelFile(model, getFullAction());
    getProject().refreshProject();
   
    // try renaming the model file
    // (otherwise, it seems only the old diagram is stored in memory, and the test case below fails)
    model.move(modelNew.getFullPath(), true, monitor);
    getProject().refreshProject();
   
    assertTrue("New model file " + modelNew + " exists", modelNew.exists());
 
    // re-init diagram and reload
    initialiseAndLoadDiagram(modelNew, diagramNew);
   
    {
      // there should now be three children
      assertEditorHasChildren(3, editor);
     
      // get contents
      ShapeNodeEditPart target = assertHasFrame(editor, "target");
      assertHasFrame(editor, "other");
      assertHasFrame(editor, "outside activation");
     
      // however, if we open up the text field, there should be elements
      // in here generated
View Full Code Here

 
    // there should now be three children
    assertEditorHasChildren(3, editor);
   
    // get contents
    ShapeNodeEditPart target = assertHasFrame(editor, "target");
    assertHasFrame(editor, "other");
    assertHasFrame(editor, "outside activation");
   
    // however, if we open up the text field, there should be elements
    // in here generated
View Full Code Here

    assertEditorFrame(editor_page);
   
    assertEditorHasChildren(3, editor_page);
   
    // previously
    ShapeNodeEditPart t1 = assertHasInputTextField(editor_page, "target text field");
    assertNotGenerated(t1);
    ShapeNodeEditPart t2 = assertHasInputTextField(editor_page, "in sync");
    assertNotGenerated(t2);
   
    // generated
    ShapeNodeEditPart t3 = assertHasInputTextField(editor_page, "created");
    assertGenerated(t3);
   
    // no input form (outside activation)!
    assertNotHasInputForm(editor_page, "created");
   
View Full Code Here

   
    // plus an InputForm!
    assertEditorHasChildren(4, editor_page);
   
    // previously
    ShapeNodeEditPart t1 = assertHasInputTextField(editor_page, "target text field");
    assertNotGenerated(t1);
    ShapeNodeEditPart t2 = assertHasInputTextField(editor_page, "in sync");
    assertNotGenerated(t2);
   
    // generated
    ShapeNodeEditPart t3 = assertHasInputTextField(editor_page, "created");
    assertGenerated(t3);
   
    // no input form (outside activation)!
    ShapeNodeEditPart f1 = assertHasInputForm(editor_page, "created");
    assertGenerated(f1);
  }
View Full Code Here

   */
  public void testInitial() throws Exception {
    initializeModelFile();

    // open page
    ShapeNodeEditPart page = assertHasFrame(editor, "container");
    editor_page = openDiagram(page);
    assertEditorFrame(editor_page);

    // there should be six children
    assertEditorHasChildren(6, editor_page);
    ShapeNodeEditPart target = assertHasInputTextField(editor_page, "target", false);
    assertGenerated(target);
    ShapeNodeEditPart unrelated = assertHasInputTextField(editor_page, "unrelated", false);
    assertGenerated(unrelated);

    ShapeNodeEditPart edit = assertHasEvent(editor_page, true, ModelPackage.eINSTANCE.getChangeable_OnChange());
    assertGenerated(edit);
    ShapeNodeEditPart incoming = assertHasOperation(editor_page, "incoming", false);
    assertNotGenerated(incoming);
    assertHasECARule(editor_page, edit, incoming, "run out");

    ShapeNodeEditPart outgoing = assertHasEvent(editor_page, false, ModelPackage.eINSTANCE.getAccessible_OnAccess());
    assertNotGenerated(outgoing);
    ShapeNodeEditPart update = assertHasOperation(editor_page, "update", true);
    assertGenerated(update);
    assertHasECARule(editor_page, outgoing, update, "run in");

    // open the target
    //editor_target = openDiagram(target);
View Full Code Here

   */
  public void testDeleteConfirm() throws Exception {
    initializeModelFile();

    // open page
    ShapeNodeEditPart page = assertHasFrame(editor, "container");
    editor_page = openDiagram(page);
    assertEditorFrame(editor_page);

    // there should be six children
    assertEditorHasChildren(6, editor_page);
    ShapeNodeEditPart target = assertHasInputTextField(editor_page, "target", false);
    assertGenerated(target);

    // sadly, I don't know how to emulate selecting the element
    // and deleting it.
    /*
 
View Full Code Here

   */
  public void testHandler() throws Exception {
    initializeModelFile();

    // open page
    ShapeNodeEditPart page = assertHasFrame(editor, "container");
    editor_page = openDiagram(page);
    assertEditorFrame(editor_page);

    // there should be six children
    assertEditorHasChildren(6, editor_page);
    ShapeNodeEditPart target = assertHasInputTextField(editor_page, "target", false);
    assertGenerated(target);

    GeneratedElementHandler handler = new GeneratedElementHandler(target);
    assertTrue("we should have incoming edges", handler.needsConfirmation());
    assertEquals("There should only be one element to confirm", 1, handler.getConfirmationElements().size());
View Full Code Here

  public void testDeletedElements() throws Exception {
    initializeModelFile();

    // open page
    ShapeNodeEditPart page = assertHasFrame(editor, "container");
    editor_page = openDiagram(page);
    assertEditorFrame(editor_page);

    // there should be six children
    assertEditorHasChildren(6, editor_page);
    ShapeNodeEditPart target = assertHasInputTextField(editor_page, "target", false);
    assertGenerated(target);

    GeneratedElementHandler handler = new GeneratedElementHandler(target);
    List<EObject> toDelete = handler.getOtherElementsToDelete();

    // there should be two other elements that are important to delete
    assertEquals(2, toDelete.size());

    ShapeNodeEditPart edit = assertHasEvent(editor_page, true, ModelPackage.eINSTANCE.getChangeable_OnChange());
    assertGenerated(edit);
    ShapeNodeEditPart update = assertHasOperation(editor_page, "update", true);
    assertGenerated(update);
    assertContains(edit.resolveSemanticElement(), toDelete);
    assertContains(update.resolveSemanticElement(), toDelete);

    // get ALL related elements to also
    GeneratedElementDeleter deleter = new GeneratedElementDeleter((GeneratedElement) target.resolveSemanticElement());

    assertGreaterEq(6, deleter.getElementsToDelete().size());
View Full Code Here

TOP

Related Classes of org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart

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.