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

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


    assertNotShortcut(text1);
    assertNotGenerated(text1);
    ShapeNodeEditPart text2 = assertHasInputTextField(editor_page, "text field 2");
    assertNotShortcut(text2);
    assertNotGenerated(text2);
    ConnectionNodeEditPart sync = assertHasSyncWire(editor_page, text1, text2, "sync");
    assertNotGenerated(sync);

    // open the text field
    editor_text = openDiagram(text1);
    assertEditorVisual(editor_text);
   
    // should contain a field value
    ShapeNodeEditPart text1_value = assertHasFieldValue(editor_text, false);
    assertNotShortcut(text1_value);
    assertGenerated(text1_value);
    // the other fieldValue _should_ most definitely be displayed here, because
    // it's used as the parameter for an incoming operation
    ShapeNodeEditPart text2_value = assertHasFieldValue(editor_text, true);
    assertShortcut(text2_value);
    assertGenerated(text2_value);
   
    // editor should contain both "edit" and "update" operations for
    // text1 and text2
    ShapeNodeEditPart text1_edit = assertHasEvent(editor_text, false, ModelPackage.eINSTANCE.getChangeable_OnChange() );
    ShapeNodeEditPart text2_edit = assertHasEvent(editor_text, true,  ModelPackage.eINSTANCE.getChangeable_OnChange());
    assertNotSame(text1_edit, text2_edit);
    assertGenerated(text1_edit);
    assertGenerated(text2_edit);
   
    ShapeNodeEditPart text1_update = assertHasOperation(editor_text, "update", false);
    ShapeNodeEditPart text2_update = assertHasOperation(editor_text, "update", true);
    assertNotSame(text1_update, text2_update);
    assertGenerated(text1_update);
    assertGenerated(text2_update);
   
    // these should be connected
    ConnectionNodeEditPart text1_run = assertHasECARule(editor_text, text1_edit, text2_update, "run");
    assertGenerated(text1_run);
    ConnectionNodeEditPart text1_param = assertHasParameter(editor_text, text1_value, text1_run);
    assertGenerated(text1_param);
   
    ConnectionNodeEditPart text2_run = assertHasECARule(editor_text, text2_edit, text1_update, "run");
    assertGenerated(text2_run);
    ConnectionNodeEditPart text2_param = assertHasParameter(editor_text, text2_value, text2_run);
    assertGenerated(text2_param);

  }
View Full Code Here


     
      // the button runs an external operation, which is a shortcut
      ShapeNodeEditPart op = assertHasActivityOperation(editor_page, "some operation", true);
     
      // connected by a RunAction
      ConnectionNodeEditPart run = assertHasECARule(editor_page, button, op, "onClick");
     
      // this RunAction has an incoming parameter
      assertHasParameter(editor_page, staticValue, run);
     
      // there should only be three children (as above)
View Full Code Here

       
        // there is a shortcutted operation
        ShapeNodeEditPart op = assertHasActivityOperation(editor_button, "some operation", true);
       
        // the event is connected to the op by a RunAction
        ConnectionNodeEditPart run = assertHasECARule(editor_button, event, op, "run");
       
        // there is also a shortcutted StaticValue, which is the parameter
        ShapeNodeEditPart staticValue = assertHasValue(editor_button, "parameter", true);
       
        // which is connected to the RunAction
View Full Code Here

     
      // there is a shortcutted button 'direct'
      ShapeNodeEditPart button = assertHasButton(editor_page, "direct", true);
     
      // connected by a RunAction to the operation
      ConnectionNodeEditPart run = assertHasECARule(editor_page, button, op, "onClick");
     
      // there is a shortcutted event 'onChange'
      ShapeNodeEditPart event = assertHasEvent(editor_page, true, ModelPackage.eINSTANCE.getChangeable_OnChange());
     
      // also connected by a RunAction
      ConnectionNodeEditPart run2 = assertHasECARule(editor_page, event, op, "run");
     
      // finally, there is a static value that has a shortcut
      ShapeNodeEditPart staticValue = assertHasValue(editor_page, "parameter", true);
     
      // connected to both run actions
View Full Code Here

  public ConnectionNodeEditPart assertHasECARule(DiagramDocumentEditor editor, EditPart source, EditPart target, String name) {
    String found = "";

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

  public ConnectionNodeEditPart assertHasSimpleCondition(DiagramDocumentEditor editor, EditPart source, EditPart target, String name) {
    String found = "";

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

  public ConnectionNodeEditPart assertHasSimpleCondition(DiagramDocumentEditor editor, EditPart source, EditPart target) {
    String found = "";

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

   * Assert that a DataFlowEdge exists between two elements in the editor.
   */
  public ConnectionNodeEditPart assertHasDataFlowEdge(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 DataFlowEdge) {
          if (connection.getSource().equals(source) &&
              connection.getTarget().equals(target))
            return connection;  // found it
        }
      }
    }

View Full Code Here

      EditPart part1, EditPart part2, String name) {
    String found = "";

    for (Object c : editor.getDiagramEditPart().getConnections()) {
      if (c instanceof ConnectionNodeEditPart) {
        ConnectionNodeEditPart connection = (ConnectionNodeEditPart) c;
        EObject element = connection.resolveSemanticElement();
        if (element instanceof SyncWire) {
          SyncWire w = (SyncWire) element;
          // SyncWires are bidirectional
          if (connection.getSource().equals(part1) &&
              connection.getTarget().equals(part2) && w.getName().equals(name))
            return connection;  // found it (a->b)
          if (connection.getSource().equals(part2) &&
              connection.getTarget().equals(part1) && w.getName().equals(name))
            return connection;  // found it (b->a)
          found += ", " + w.getName();
        }
      }
    }
View Full Code Here

   */
  public ConnectionNodeEditPart assertHasExecutionEdge(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 ExecutionEdge) {
          if (connection.getSource().equals(source) &&
              connection.getTarget().equals(target))
            return connection;  // found it
        }
      }
    }

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.