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

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


   */
  public ConnectionNodeEditPart assertHasSelectEdge(DiagramDocumentEditor editor, EditPart source, EditPart target) {

    for (Object c : editor.getDiagramEditPart().getConnections()) {
      if (c instanceof ConnectionNodeEditPart) {
        ConnectionNodeEditPart connection = (ConnectionNodeEditPart) c;
        EObject element = connection.resolveSemanticElement();
        if (element instanceof SelectEdge) {
          if (connection.getSource().equals(source) &&
              connection.getTarget().equals(target))
            return connection;  // found it
        }
      }
    }

View Full Code Here


    String found = "";

    for (Object c : editor.getDiagramEditPart().getConnections()) {
      if (c instanceof ConnectionNodeEditPart) {
        ConnectionNodeEditPart connection = (ConnectionNodeEditPart) c;
        EObject element = connection.resolveSemanticElement();
        if (element instanceof Parameter) {
          Parameter w = (Parameter) element;
          if (connection.getSource().equals(source) &&
              connection.getTarget().equals(target))
            return connection;  // found it
          found += ", " + w.getName();
        }
      }
    }
View Full Code Here

      assertNotShortcut(text1);
      assertNotGenerated(text1);
      ShapeNodeEditPart text2 = assertHasInputTextField(editor_page, "in sync");
      assertNotShortcut(text2);
      assertNotGenerated(text2);
      ConnectionNodeEditPart sync = assertHasSyncWire(editor_page, text1, text2, "sync");
      assertNotGenerated(sync);
     
      // select the first text field and infer!
      runAction(new InferContainedElementsAction(), text1);
     
      // save it
      editor_page.doSave(new NullProgressMonitor());
     
      // there should not be any new elements in the local editor
      assertEditorHasChildren(2, editor_page);
     
      // however, if we open up the text field, there should be elements
      // in here generated
      editor_text = openDiagram(text1);
 
      checkPartialInferenceEditor();
     
      // however, if we now close this diagram and infer in place,
      // we should get the rest of the normal editor
      editor_text.close(false);
      editor_text = null;
      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");
    if (modelNew.exists()) {
      getProject().haltDelete(modelNew);
     
    }
    if (diagramNew.exists()) {
      getProject().haltDelete(diagramNew);
    }
    assertFalse(modelNew.exists());
    assertFalse(diagramNew.exists());
   
    // infer
    inferSourceModelFile(model);
    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 only be two children
      assertEditorHasChildren(2, editor);
     
      // open page
      ShapeNodeEditPart page = assertHasFrame(editor, "target");
      editor_page = openDiagram(page);
      assertEditorFrame(editor_page);
     
      // there should be three children (text fields and access and init)
      assertEditorHasChildren(4, editor_page);
      ShapeNodeEditPart text1 = assertHasInputTextField(editor_page, "target text field");
      assertNotShortcut(text1);
      assertNotGenerated(text1);
      ShapeNodeEditPart text2 = assertHasInputTextField(editor_page, "in sync");
      assertNotShortcut(text2);
      assertNotGenerated(text2);
      ConnectionNodeEditPart sync = assertHasSyncWire(editor_page, text1, text2, "sync");
      assertNotGenerated(sync);
      ShapeNodeEditPart access = assertHasEvent(editor_page, false, ModelPackage.eINSTANCE.getAccessible_OnAccess());
      assertGenerated(access);
      ShapeNodeEditPart init = assertHasEvent(editor_page, false, ModelPackage.eINSTANCE.getScope_OnInit());
      assertGenerated(init);
View Full Code Here

    assertNotShortcut(text1);
    assertNotGenerated(text1);
    ShapeNodeEditPart text2 = assertHasInputTextField(editor_page, "in sync");
    assertNotShortcut(text2);
    assertNotGenerated(text2);
    ConnectionNodeEditPart sync = assertHasSyncWire(editor_page, text1, text2, "sync");
    assertNotGenerated(sync);
    ShapeNodeEditPart access = assertHasEvent(editor_page, false, ModelPackage.eINSTANCE.getAccessible_OnAccess());
    assertGenerated(access);
    ShapeNodeEditPart init = assertHasEvent(editor_page, false,ModelPackage.eINSTANCE.getScope_OnInit());
    assertGenerated(init);
View Full Code Here

    assertGenerated(hide);
    assertGenerated(onClick);
    assertGenerated(onInput);
   
    // connected by run wire
    ConnectionNodeEditPart run = assertHasECARule(editor_text, access, init, "run");
    assertGenerated(run);
  }
View Full Code Here

    ShapeNodeEditPart edit = assertHasEvent(editor_text, false, ModelPackage.eINSTANCE.getChangeable_OnChange());
    ShapeNodeEditPart init = assertHasOperation(editor_text, "init", false);
    ShapeNodeEditPart fieldValue = assertHasFieldValue(editor_text, false);
   
    // connected by run wire
    ConnectionNodeEditPart run = assertHasECARule(editor_text, access, init, "run");
    assertGenerated(run);
    ConnectionNodeEditPart param = assertHasParameter(editor_text, fieldValue2, run);
    assertGenerated(param);
   
    // connected by run wire
    ConnectionNodeEditPart run2 = assertHasECARule(editor_text, edit, update2, "run");
    assertGenerated(run2);
    ConnectionNodeEditPart param2 = assertHasParameter(editor_text, fieldValue, run2);
    assertGenerated(param2);
   
    // connected by condition wire
    ConnectionNodeEditPart condWire = assertHasSimpleCondition(editor_text, condition2, run);
    assertGenerated(condWire);
  }
View Full Code Here

        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);
        ConnectionNodeEditPart s2 = assertHasSyncWire(editor_form, a2, d2, "sync");
        assertGenerated(s2);
        ConnectionNodeEditPart s3 = assertHasSyncWire(editor_form, a3, d3, "sync");
        assertGenerated(s3);
      } finally {
        editor_form.close(false);
      }
     
View Full Code Here

TOP

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

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.