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

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


        "  {new: com.extjs.gxt.ui.client.widget.layout.FillLayout} {empty} {/setLayout(new FillLayout(Orientation.HORIZONTAL))/}");
    assertSame(layout, container.getLayout());
  }

  public void test_setLayout_HORIZONTAL() 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", "horizontal");
    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 horizontal} {empty} {/setLayout(new FillLayout(Orientation.HORIZONTAL))/}");
    assertSame(layout, container.getLayout());
  }
View Full Code Here


  /**
   * Test for new {@link SliderFieldInfo}.
   */
  public void test_CREATE() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new FormLayout());",
            "  }",
            "}");
    container.refresh();
    FormLayoutInfo layout = (FormLayoutInfo) container.getLayout();
    // add new SliderField
    final FlowContainer flowContainer = new FlowContainerFactory(layout, false).get().get(0);
    ExecutionUtils.run(container, new RunnableEx() {
      public void run() throws Exception {
        FieldInfo newField = createJavaInfo("com.extjs.gxt.ui.client.widget.form.SliderField");
View Full Code Here

        "  {new: com.extjs.gxt.ui.client.widget.layout.FillLayout horizontal} {empty} {/setLayout(new FillLayout(Orientation.HORIZONTAL))/}");
    assertSame(layout, container.getLayout());
  }

  public void test_setLayout_VERTICAL() 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", "vertical");
    container.setLayout(layout);
    assertEditor(
        "// filler filler filler",
        "public class Test extends LayoutContainer {",
        "  public Test() {",
        "    setLayout(new FillLayout(Orientation.VERTICAL));",
        "  }",
        "}");
    assertHierarchy(
        "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {/setLayout(new FillLayout(Orientation.VERTICAL))/}",
        "  {new: com.extjs.gxt.ui.client.widget.layout.FillLayout vertical} {empty} {/setLayout(new FillLayout(Orientation.VERTICAL))/}");
    assertSame(layout, container.getLayout());
  }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for {@link FillLayoutInfo#isHorizontal()}.
   */
  public void test_isHorizontal_true() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new FillLayout(Orientation.HORIZONTAL));",
            "  }",
            "}");
    container.refresh();
    FillLayoutInfo layout = (FillLayoutInfo) container.getLayout();
    assertTrue(layout.isHorizontal());
  }
View Full Code Here

  /**
   * Test for {@link FillLayoutInfo#isHorizontal()}.
   */
  public void test_isHorizontal_false() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new FillLayout(Orientation.VERTICAL));",
            "  }",
            "}");
    container.refresh();
    FillLayoutInfo layout = (FillLayoutInfo) container.getLayout();
    assertFalse(layout.isHorizontal());
  }
View Full Code Here

  //
  // Margins
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_getMargin_get() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new FillLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button, new FillData(1, 2, 3, 4));",
            "    }",
            "  }",
            "}");
    container.refresh();
    WidgetInfo button = container.getWidgets().get(0);
    FillDataInfo fillData = FillLayoutInfo.getFillData(button);
    // check margins
    assertSame(Property.UNKNOWN_VALUE, fillData.getMarginAll());
    assertEquals(1, fillData.getMarginTop());
    assertEquals(2, fillData.getMarginRight());
View Full Code Here

    assertEquals(3, fillData.getMarginBottom());
    assertEquals(4, fillData.getMarginLeft());
  }

  public void test_getMargin_virtual() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new FillLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button);",
            "    }",
            "  }",
            "}");
    container.refresh();
    WidgetInfo button = container.getWidgets().get(0);
    FillDataInfo fillData = FillLayoutInfo.getFillData(button);
    // check margins
    assertEquals(0, fillData.getMarginAll());
    assertEquals(0, fillData.getMarginTop());
    assertEquals(0, fillData.getMarginRight());
View Full Code Here

  /**
   * Test applying creation flow order.
   */
  public void test_BOUNDS_CreationFlow() throws Exception {
    preferences.setValue(IPreferenceConstants.P_CREATION_FLOW, true);
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button, new AbsoluteData(100, 50));",
            "    }",
            "    {",
            "      Text text = new Text();",
            "      add(text, new AbsoluteData(150, 100));",
            "    }",
            "  }",
            "}");
    container.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) container.getLayout();
    ComponentInfo text = container.getChildren(ComponentInfo.class).get(1);
    // Bounds
    layout.command_BOUNDS(text, new Point(5, 5), null);
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
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 FitLayout
    FitLayoutInfo layout = createJavaInfo("com.extjs.gxt.ui.client.widget.layout.FitLayout");
    container.setLayout(layout);
    assertEditor(
        "// filler filler filler",
        "public class Test extends LayoutContainer {",
        "  public Test() {",
        "    setLayout(new FitLayout());",
        "  }",
        "}");
    assertHierarchy(
        "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {/setLayout(new FitLayout())/}",
        "  {new: com.extjs.gxt.ui.client.widget.layout.FitLayout} {empty} {/setLayout(new FitLayout())/}");
    assertSame(layout, container.getLayout());
  }
View Full Code Here

        "  {new: com.extjs.gxt.ui.client.widget.layout.FitLayout} {empty} {/setLayout(new FitLayout())/}");
    assertSame(layout, container.getLayout());
  }

  public void test_command_CREATE() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new FitLayout());",
            "  }",
            "}");
    container.refresh();
    FitLayoutInfo layout = (FitLayoutInfo) container.getLayout();
    //
    ComponentInfo newButton = createButton();
    layout.command_CREATE(newButton, null);
    assertEditor(
        "public class Test extends LayoutContainer {",
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.