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

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


  public void testOpenSubdiagramsPage2() throws Exception {
    migrateModel();
   
    // open the diagram
    ShapeNodeEditPart page = assertHasFrame(editor, "page2");
    assertNotNull(page);

    editor_page = openDiagram(page);
    assertEditorFrame(editor_page);
   
View Full Code Here


   * @throws Exception
   */
  public void testPage() throws Exception {
    migrateModel();
   
    ShapeNodeEditPart part = assertHasFrame(editor, "a page");
    assertNotNull(part);
   
    Frame page = (Frame) part.resolveSemanticElement();
    assertEquals(page.getName(), "a page");
   
    // open diagram
    DiagramDocumentEditor sub = openDiagram(part);
    assertEditorFrame(sub);
   
    // check contents
    assertEditorHasChildren(2, sub);
    {
      ShapeNodeEditPart p = assertHasDomainAttribute(sub, "da");
      assertNotNull(p);
     
      DomainAttribute obj = (DomainAttribute) p.resolveSemanticElement();
      assertEquals(obj.getName(), "da");
    }
    {
      ShapeNodeEditPart p = assertHasDomainAttribute(sub, "fa");
      assertNotNull(p);
     
      DomainAttribute obj = (DomainAttribute) p.resolveSemanticElement();
      assertEquals(obj.getName(), "fa");
    }
   
    sub.close(false);
  }
View Full Code Here

  }
 
  public void testLoadModel() throws Exception {
    migrateModel();
   
    ShapeNodeEditPart page = assertHasFrame(editor, "Home");
    assertNotNull(page);
   
    // open page
    editor_page = openDiagram(page);
    assertEditorFrame(editor_page);
   
    ShapeNodeEditPart operation = assertHasOperation(editor_page, "target operation");
    assertNotNull(operation);

    // open operation
    editor_operation = openDiagram(operation);
    assertEditorOperation(editor_operation);
View Full Code Here

  }
 
  public void testLoadModel() throws Exception {
    migrateModel();
   
    ShapeNodeEditPart page = assertHasFrame(editor, "Home");
    assertNotNull(page);
   
    assertEditorHasChildren(1, editor);
   
    // open page
    editor_page = openDiagram(page);
    try {
      assertEditorFrame(editor_page);
     
      // lots of buttons
      {
        ShapeNodeEditPart button = assertHasButton(editor_page, "reset");
        assertNotGenerated(button);
      }

      {
        ShapeNodeEditPart button = assertHasButton(editor_page, "next");
        assertNotGenerated(button);
      }

      {
        ShapeNodeEditPart button = assertHasButton(editor_page, "possibly next");
        assertNotGenerated(button);
      }

      {
        ShapeNodeEditPart button = assertHasButton(editor_page, "previous");
        assertNotGenerated(button);
      }

      {
        ShapeNodeEditPart button = assertHasButton(editor_page, "possibly previous");
        assertNotGenerated(button);
      }

    } finally {
      editor_page.close(false);
View Full Code Here

    // there should be four children
    assertEditorHasChildren(1, editor);
   
    // check the contents
    ShapeNodeEditPart page = assertHasFrame(editor, "container");

    // open the page
    editor_page = openDiagram(page);
    assertEditorFrame(editor_page);
   
    // there should be two children (text fields)
    assertEditorHasChildren(2, editor_page);
    ShapeNodeEditPart text1 = assertHasInputTextField(editor_page, "text field 1");
    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
View Full Code Here

    initializeModelFile();
    assertEditorRoot(editor);

    assertEditorHasChildren(2, editor);
   
    ShapeNodeEditPart page = assertHasFrame(editor, "Home", false);
    assertHasOperation(editor, "root operation", false);
   
    // open the page
    editor_page = openDiagram(page);
    assertEditorVisual(editor_page);

    ShapeNodeEditPart event = assertHasEvent(editor_page, "access", false);
    // shortcut
    ShapeNodeEditPart op = assertHasOperation(editor_page, "target operation", true);
    assertHasECARule(editor_page, event, op, "run");
   
    assertEditorHasChildren(2, editor_page);

  }
View Full Code Here

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

    assertEditorHasChildren(2, editor);
   
    ShapeNodeEditPart home = assertHasFrame(editor, "Home");
   
    // open the page
    editor_page = openDiagram(home);
    try {
      assertEditorFrame(editor_page);
     
      // directly, there is a button and a static value
      ShapeNodeEditPart button = assertHasButton(editor_page, "direct");
      ShapeNodeEditPart staticValue = assertHasValue(editor_page, "parameter");
     
      // 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
View Full Code Here

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

    assertEditorHasChildren(2, editor);
   
    ShapeNodeEditPart home = assertHasFrame(editor, "Home");
   
    // open the page
    editor_page = openDiagram(home);
    try {
      assertEditorFrame(editor_page);
     
      // directly, there is a button and a static value
      ShapeNodeEditPart button = assertHasButton(editor_page, "direct");
     
      // open the button
      DiagramDocumentEditor editor_button = openDiagram(button);
      try {
       
        // it has an event trigger onChange (not a shortcut)
        ShapeNodeEditPart event = assertHasEvent(editor_button, false, ModelPackage.eINSTANCE.getChangeable_OnChange());
       
        // 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
        assertHasParameter(editor_button, staticValue, run);

        // there should only be three children (as above)
View Full Code Here

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

    assertEditorHasChildren(2, editor);
   
    ShapeNodeEditPart target = assertHasFrame(editor, "Target");
   
    // open the page
    editor_page = openDiagram(target);
    try {
      assertEditorFrame(editor_page);
     
      // we contain the operation directly
      ShapeNodeEditPart op = assertHasActivityOperation(editor_page, "some operation", false);
     
      // 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
      assertHasParameter(editor_page, staticValue, run);
      assertHasParameter(editor_page, staticValue, run2);
     
View Full Code Here

    // there should be four children
    assertEditorHasChildren(1, editor);
   
    // check the contents
    ShapeNodeEditPart page = assertHasFrame(editor, "container");

    // open the page
    editor_page = openDiagram(page);

    assertEditorFrame(editor_page);

    // note that even though there is an executionedge from chained -> final,
    // it should not display
    assertEditorHasChildren(2, editor_page);
    ShapeNodeEditPart composite = assertHasOperation(editor_page, "composite");
    ShapeNodeEditPart opFinal = assertHasOperation(editor_page, "final");
   
    // open up the operation
    editor_operation = openDiagram(composite);

    assertEditorOperation(editor_operation);
   
    // it should have a domain attribute connected to an event trigger
    assertEditorHasChildren(3, editor_operation);
    ShapeNodeEditPart startNode = assertHasStartNode(editor_operation);
    ShapeNodeEditPart chained = assertHasOperation(editor_operation, "chained");
    ShapeNodeEditPart opFinal2 = assertHasOperation(editor_operation, "final");
   
    // they should be connected
    assertHasExecutionEdge(editor_operation, startNode, chained);
    assertHasExecutionEdge(editor_operation, chained, opFinal2);
    assertNotShortcut(startNode);
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.