Examples of SWTBotGefEditPart


Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

        de.getMouseLocation().y = 20;

        final SWTBotGefEditor editor = mBot.gefEditor("test");
       
        //Should activate with double click
        SWTBotGefEditPart ep = editor.getEditPart("\"DirectEditTest\""
            ).doubleClick();
      }
    });
   
    Thread.sleep(100);
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

  @Test
  public void doubleClick() throws Exception {
    editor.activateTool(TOOL_CIRCUIT);
    editor.click(10, 10);

    SWTBotGefEditPart circuitEditPart = editor.editParts(instanceOf(CircuitEditPart.class)).get(0);
    Circuit circuit = (Circuit) circuitEditPart.part().getModel();
    final String nameBeforeDoubleClick = circuit.getName();
    editor.select(circuitEditPart).doubleClick(15, 15);   
   
    /* we need to wait that double click  have been executed */
    syncWithUIThread();
 
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

 
  @Test
  public void getEditPartWithLabelOnCanvas() throws Exception {
    editor.activateTool(TOOL_LABEL);
    editor.click(10, 10);
    SWTBotGefEditPart botPart = editor.getEditPart("Label");
    assertNotNull(botPart);
    assertTrue(botPart.part() instanceof LogicLabelEditPart);
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

    editor.activateTool(TOOL_CIRCUIT);
    editor.click(10, 10);
    editor.activateTool(TOOL_LABEL);
    editor.click(10 + 3, 10 + 3);

    SWTBotGefEditPart botPart = editor.getEditPart("Label");
    assertNotNull(botPart);
    assertTrue(botPart.part() instanceof LogicLabelEditPart);
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

  @Test
  public void dragOnResizableElement() throws Exception {
    editor.activateTool(TOOL_CIRCUIT);
    editor.click(30, 30);
    SWTBotGefEditPart circuitEditPart = editor.editParts(instanceOf(CircuitEditPart.class)).get(0);
    Rectangle boundsBeforeDrag = getBounds(circuitEditPart);
    editor.drag(circuitEditPart, 50, 50);
    syncWithUIThread();
    checkSize(getBounds(circuitEditPart), boundsBeforeDrag.width, boundsBeforeDrag.height);
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

    editor.click(offset, offset);

    editor.activateTool(TOOL_CIRCUIT);
    editor.click(circuitFigureSize * 2 + offset, offset);

    SWTBotGefEditPart circuitEditPart1 = editor.editParts(instanceOf(CircuitEditPart.class)).get(0);
    SWTBotGefEditPart circuitEditPart2 = editor.editParts(instanceOf(CircuitEditPart.class)).get(1);

    /* create a child of circuitEditPart1 */
    editor.activateTool(TOOL_CIRCUIT);
    editor.click(circuitFigureSize / 2 + offset, circuitFigureSize / 2 + offset);

    SWTBotGefEditPart circuitEditPart1child = circuitEditPart1.children().get(0);

    editor.drag(circuitEditPart1child, 5 * (circuitFigureSize / 2) + offset, circuitFigureSize / 2 + offset);
    syncWithUIThread();
    assertFalse(circuitEditPart2.children().isEmpty());
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

  @Test
  public void resize() throws Exception {
    editor.activateTool(TOOL_CIRCUIT);
    editor.click(30, 30);
    SWTBotGefEditPart circuitEditPart = editor.editParts(instanceOf(CircuitEditPart.class)).get(0);
    Rectangle boundsBeforeResize = getBounds(circuitEditPart);

    circuitEditPart.resize(PositionConstants.SOUTH_WEST, 200, 200);
    syncWithUIThread();
    Rectangle boundsAfterResize = getBounds(circuitEditPart);
    checkLocation(boundsAfterResize, boundsBeforeResize.x, boundsBeforeResize.y);
    checkSize(boundsAfterResize, 200, 200);

    circuitEditPart.resize(PositionConstants.EAST, 150, 200);
    syncWithUIThread();
    boundsAfterResize = getBounds(circuitEditPart);
    checkLocation(boundsAfterResize, boundsBeforeResize.x + 50, boundsBeforeResize.y);
    checkSize(boundsAfterResize, 150, 200);

    circuitEditPart.resize(PositionConstants.NORTH, 150, 50);
    syncWithUIThread();
    boundsAfterResize = getBounds(circuitEditPart);
    checkLocation(boundsAfterResize, boundsBeforeResize.x + 50, boundsBeforeResize.y + 150);
    checkSize(boundsAfterResize, 150, 50);

    circuitEditPart.resize(PositionConstants.NORTH_EAST, 175, 75);
    syncWithUIThread();
    boundsAfterResize = getBounds(circuitEditPart);
    checkLocation(boundsAfterResize, boundsBeforeResize.x + 25, boundsBeforeResize.y + 125);
    checkSize(boundsAfterResize, 175, 75);
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

    editor.click(120, 10);
    editor.activateTool(TOOL_CONNECTION);
    editor.drag(100, 20, 130, 20);
    editor.click(130, 20);

    final SWTBotGefEditPart circuitPart = editor.editParts(instanceOf(CircuitEditPart.class)).get(0);
    final SWTBotGefConnectionEditPart wirePart = circuitPart.sourceConnections().get(0);
    final Wire wire = (Wire) (wirePart.part()).getModel();
    final Connection connection = (Connection) wirePart.part().getFigure();

    editor.activateTool("Select");
    assertEquals("Select", getActiveToolLabel());
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

    editor.click(130, 20);

    editor.activateTool("Select");
    assertEquals("Select", getActiveToolLabel());

    final SWTBotGefEditPart circuitPart = editor.editParts(instanceOf(CircuitEditPart.class)).get(0);
    final SWTBotGefConnectionEditPart wirePart = circuitPart.sourceConnections().get(0);
    final Wire wire = (Wire) wirePart.part().getModel();

    assertEquals(0, wire.getBendpoints().size());
    wirePart.createBenpoint(130, 250);
    /* we need to wait the drag operates */
 
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart

  @Test
  public void deprecatedGetEditPartWithLabelOnCanvas() throws Exception {
    editor.activateTool(TOOL_LABEL);
    editor.mouseMoveLeftClick(10, 10);
    SWTBotGefEditPart botPart = editor.getEditPart("Label");
    assertNotNull(botPart);
    assertTrue(botPart.part() instanceof LogicLabelEditPart);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.