Package org.eclipse.wb.gef.graphical

Examples of org.eclipse.wb.gef.graphical.GraphicalEditPart


  @Override
  protected boolean isRequestCondition(Request _request) {
    if (_request instanceof ChangeBoundsRequest) {
      ChangeBoundsRequest request = (ChangeBoundsRequest) _request;
      Object type = request.getType();
      GraphicalEditPart host = getHost();
      ILayoutRequestValidator validator = getRequestValidator();
      boolean isMove =
          Request.REQ_MOVE.equals(type) && validator.validateMoveRequest(host, request);
      boolean isAdd = Request.REQ_ADD.equals(type) && validator.validateMoveRequest(host, request);
      return isMove || isAdd;
View Full Code Here


              "// filler filler filler filler filler",
              "// filler filler filler filler filler",
              "<ui:UiBinder>",
              "  <g:FlowPanel/>",
              "</ui:UiBinder>");
      GraphicalEditPart panelEditPart = canvas.getEditPart(originalPanel);
      Figure panelFigure = panelEditPart.getFigure();
      // no device yet
      assertEquals(new Rectangle(20, 20, 450, 300), panelFigure.getBounds());
      // set device
      DeviceSelectionSupport.setDevice(originalPanel, DeviceManager.getDevice("generic.qvga"));
      assertEquals(new Rectangle(25, 25, 240, 320), panelFigure.getBounds());
    }
    // parse again
    {
      openSourcePage();
      m_lastContext.getDocument().replace(0, 0, " ");
      openDesignPage();
      fetchContentFields();
    }
    // ...still has device
    {
      assertNotSame(originalPanel, m_contentObject);
      GraphicalEditPart panelEditPart = canvas.getEditPart(m_contentObject);
      Figure panelFigure = panelEditPart.getFigure();
      assertEquals(new Rectangle(25, 25, 240, 320), panelFigure.getBounds());
    }
  }
View Full Code Here

              "// filler filler filler filler filler",
              "public class Test extends FlowPanel {",
              "  public Test() {",
              "  }",
              "}");
      GraphicalEditPart panelEditPart = canvas.getEditPart(originalPanel);
      Figure panelFigure = panelEditPart.getFigure();
      // no device yet
      assertEquals(new Rectangle(20, 20, 450, 300), panelFigure.getBounds());
      assertTrue(hasTopSelectionPolicy(panelEditPart));
      // set device
      DeviceSelectionSupport.setDevice(originalPanel, DeviceManager.getDevice("generic.qvga"));
      assertEquals(new Rectangle(25, 25, 240, 320), panelFigure.getBounds());
      assertFalse(hasTopSelectionPolicy(panelEditPart));
    }
    // parse again
    {
      openSourcePage();
      m_lastEditor.replaceSubstring(0, 0, " ");
      m_lastEditor.commitChanges();
      openDesignPage();
      fetchContentFields();
    }
    // ...still has device
    {
      ComplexPanelInfo newPanel = (ComplexPanelInfo) m_contentJavaInfo;
      assertNotSame(originalPanel, newPanel);
      // has device
      assertNotNull(DeviceSelectionSupport.getDevice(newPanel));
      // device bounds applied
      GraphicalEditPart panelEditPart = canvas.getEditPart(newPanel);
      Figure panelFigure = panelEditPart.getFigure();
      assertEquals(new Rectangle(25, 25, 240, 320), panelFigure.getBounds());
      assertFalse(hasTopSelectionPolicy(panelEditPart));
      // remove device
      DeviceSelectionSupport.setDevice(newPanel, null);
      assertEquals(new Rectangle(20, 20, 240, 320), panelFigure.getBounds());
View Full Code Here

            "// filler filler filler filler filler",
            "public class Test extends FlowPanel {",
            "  public Test() {",
            "  }",
            "}");
    GraphicalEditPart panelEditPart = canvas.getEditPart(panel);
    Figure panelFigure = panelEditPart.getFigure();
    // set device
    {
      DeviceSelectionSupport.setDevice(panel, DeviceManager.getDevice("generic.qvga"));
      assertEquals(new Rectangle(25, 25, 240, 320), panelFigure.getBounds());
      assertSame(Orientation.PORTRAIT, DeviceSelectionSupport.getOrientation(panel));
View Full Code Here

            "// filler filler filler filler filler",
            "public class Test extends FlowPanel {",
            "  public Test() {",
            "  }",
            "}");
    GraphicalEditPart panelEditPart = canvas.getEditPart(panel);
    Figure panelFigure = panelEditPart.getFigure();
    // no device yet
    assertEquals(new Rectangle(20, 20, 450, 300), panelFigure.getBounds());
    // set device
    {
      UiContext context = new UiContext();
View Full Code Here

  private void check_SomeLayout0(String setLayoutSource, boolean horizontal) throws Exception {
    PanelInfo panel =
        openPanel("public class Test extends Panel {", "  public Test() {", "    "
            + setLayoutSource, "  }", "}");
    // CREATE "label_1"
    GraphicalEditPart labelPart_1;
    {
      JavaInfo label_1 = loadCreationTool("com.gwtext.client.widgets.form.Label");
      canvas.moveTo(panel, 0, 0);
      canvas.assertEmptyFlowContainerFeedback(panel, horizontal);
      // click, so finish creation
      canvas.click();
      canvas.assertNoFeedbacks();
      label_1.getPropertyByTitle("text").setValue("111111111");
      label_1.getVariableSupport().setName("label_1");
      //
      labelPart_1 = canvas.getEditPart(label_1);
      isExistingAndSelectedPart(labelPart_1);
    }
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    " + setLayoutSource,
        "    {",
        "      Label label_1 = new Label('111111111');",
        "      add(label_1);",
        "    }",
        "  }",
        "}");
    // CREATE "label_2" before "label_1"
    GraphicalEditPart labelPart_2;
    {
      JavaInfo label_2 = loadCreationTool("com.gwtext.client.widgets.form.Label");
      canvas.moveTo(labelPart_1);
      assertBeforeFeedback(labelPart_1, horizontal);
      // click, so finish creation
View Full Code Here

TOP

Related Classes of org.eclipse.wb.gef.graphical.GraphicalEditPart

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.