Package com.google.gdt.eclipse.designer.gxt.model.widgets

Examples of com.google.gdt.eclipse.designer.gxt.model.widgets.LayoutContainerInfo


  ////////////////////////////////////////////////////////////////////////////
  /**
   * <code>BorderLayout</code> required <code>BoxComponent</code> children.
   */
  public void test_canvas_CREATE_notBoxComponent() throws Exception {
    LayoutContainerInfo container =
        openLayoutContainer(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new BorderLayout());",
            "  }",
View Full Code Here


  public void test_canvas_CREATE_CENTER() throws Exception {
    test_canvas_CREATE(0.5, 0.5, "CENTER");
  }

  private void test_canvas_CREATE(double x, double y, String region) throws Exception {
    LayoutContainerInfo container =
        openLayoutContainer(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new BorderLayout());",
            "  }",
View Full Code Here

  //
  // Canvas
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_canvas_MOVE() throws Exception {
    LayoutContainerInfo container =
        openLayoutContainer(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new BorderLayout());",
            "    {",
View Full Code Here

        "      Button button = new Button();",
        "      add(button);",
        "    }",
        "  }",
        "}");
    LayoutContainerInfo container = getJavaInfoByName("container");
    WidgetInfo button = getJavaInfoByName("button");
    // use canvas
    canvas.beginDrag(button).dragTo(container, -10, 0.5).endDrag();
    assertEditor(
        "public class Test extends LayoutContainer {",
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_setLayout() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "// filler filler filler",
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "  }",
            "}");
    // set AnchorLayout
    AnchorLayoutInfo layout = createJavaInfo("com.extjs.gxt.ui.client.widget.layout.AnchorLayout");
    container.setLayout(layout);
    assertEditor(
        "// filler filler filler",
        "public class Test extends LayoutContainer {",
        "  public Test() {",
        "    setLayout(new AnchorLayout());",
        "  }",
        "}");
    assertHierarchy(
        "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {/setLayout(new AnchorLayout())/}",
        "  {new: com.extjs.gxt.ui.client.widget.layout.AnchorLayout} {empty} {/setLayout(new AnchorLayout())/}");
    assertSame(layout, container.getLayout());
  }
View Full Code Here

   */
  private AnchorDataInfo parse_anchorSpec(String anchorSpec) throws Exception {
    if (!"null".equals(anchorSpec)) {
      anchorSpec = "'" + anchorSpec + "'";
    }
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AnchorLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button, new AnchorData(" + anchorSpec + "));",
            "    }",
            "  }",
            "}");
    container.refresh();
    assertNoErrors(container);
    WidgetInfo button = container.getWidgets().get(0);
    AnchorDataInfo anchorData = AnchorLayoutInfo.getAnchorData(button);
    return anchorData;
  }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for flow container support.
   */
  public void test_flowContainer() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AnchorLayout());",
            "  }",
            "}");
    container.refresh();
    AnchorLayoutInfo layout = (AnchorLayoutInfo) container.getLayout();
    FlowContainer flowContainer = new FlowContainerFactory(layout, false).get().get(0);
    // add new Button
    ComponentInfo newButton = createButton();
    assertTrue(flowContainer.validateComponent(newButton));
    flowContainer.command_CREATE(newButton, null);
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_0() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    FlowLayout flowLayout = new FlowLayout();",
            "    setLayout(flowLayout);",
            "  }",
            "}");
    container.refresh();
    final Property property = container.getLayout().getPropertyByTitle("margins");
    // initially no margins
    assertFalse(property.isModified());
    assertEquals(null, getPropertyText(property));
    // set value
    property.setValue(new Insets(1, 4, 3, 2));
View Full Code Here

  //
  // setLayout()
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_setLayout() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "// filler filler filler",
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "  }",
            "}");
    // set FillLayout
    FillLayoutInfo layout = createJavaInfo("com.extjs.gxt.ui.client.widget.layout.FillLayout");
    container.setLayout(layout);
    assertEditor(
        "// filler filler filler",
        "public class Test extends LayoutContainer {",
        "  public Test() {",
        "    setLayout(new FillLayout(Orientation.HORIZONTAL));",
        "  }",
        "}");
    assertHierarchy(
        "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {/setLayout(new FillLayout(Orientation.HORIZONTAL))/}",
        "  {new: com.extjs.gxt.ui.client.widget.layout.FillLayout} {empty} {/setLayout(new FillLayout(Orientation.HORIZONTAL))/}");
    assertSame(layout, container.getLayout());
  }
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parse() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new FormLayout());",
            "    {",
            "      Slider slider = new Slider();",
            "      SliderField sliderField = new SliderField(slider);",
            "      add(sliderField);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {/setLayout(new FormLayout())/ /add(sliderField)/}",
        "  {new: com.extjs.gxt.ui.client.widget.layout.FormLayout} {empty} {/setLayout(new FormLayout())/}",
        "  {new: com.extjs.gxt.ui.client.widget.form.SliderField} {local-unique: sliderField} {/new SliderField(slider)/ /add(sliderField)/}",
        "    {new: com.extjs.gxt.ui.client.widget.Slider} {local-unique: slider} {/new Slider()/ /new SliderField(slider)/}",
        "    {virtual-layout_data: com.extjs.gxt.ui.client.widget.layout.FormData} {virtual-layout-data} {}");
    //
    container.refresh();
    assertNoErrors(container);
    // SliderField has only one constructor
    {
      SliderFieldInfo sliderField = getJavaInfoByName("sliderField");
      List<ConstructorDescription> constructors = sliderField.getDescription().getConstructors();
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.gxt.model.widgets.LayoutContainerInfo

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.