Package com.google.gdt.eclipse.designer.gwtext.model.layout

Examples of com.google.gdt.eclipse.designer.gwtext.model.layout.LayoutInfo


            "  public Test() {",
            "  }",
            "}");
    panel.refresh();
    // "default" is active
    LayoutInfo defaultLayout = panel.getLayout();
    assertTrue(defaultLayout.isActive());
    assertSame(panel, defaultLayout.getContainer());
    // set RowLayout
    LayoutInfo rowLayout;
    {
      rowLayout = createJavaInfo("com.gwtext.client.widgets.layout.RowLayout");
      panel.setLayout(rowLayout);
      assertHierarchy(
          "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/}",
          "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}");
      assertSame(rowLayout, panel.getLayout());
    }
    // RowLayout is active now
    assertTrue(rowLayout.isActive());
    assertFalse(defaultLayout.isActive());
    // both layouts bounds to same container
    assertSame(panel, rowLayout.getContainer());
    assertSame(panel, defaultLayout.getContainer());
  }
View Full Code Here


    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/add(label)/}",
        "  {implicit-layout: default} {implicit-layout} {}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label)/}");
    // set RowLayout
    LayoutInfo rowLayout = createJavaInfo("com.gwtext.client.widgets.layout.RowLayout");
    panel.setLayout(rowLayout);
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new RowLayout());",
View Full Code Here

        "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label)/}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}");
    // set ColumnLayout
    {
      LayoutInfo rowLayout = createJavaInfo("com.gwtext.client.widgets.layout.ColumnLayout");
      panel.setLayout(rowLayout);
    }
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
View Full Code Here

    assertNoErrors(panel);
    assertHierarchy(
        "{this: test.client.RowPanel} {this} {}",
        "  {implicit-layout: com.gwtext.client.widgets.layout.RowLayout} {implicit-layout} {}");
    assertTrue(panel.hasLayout());
    LayoutInfo layout = panel.getLayout();
    // check association
    assertInstanceOf(ImplicitObjectAssociation.class, layout.getAssociation());
    // check creation support
    {
      ImplicitLayoutCreationSupport creationSupport =
          (ImplicitLayoutCreationSupport) layout.getCreationSupport();
      assertEquals(panel.getCreationSupport().getNode(), creationSupport.getNode());
      assertEquals(
          "implicit-layout: com.gwtext.client.widgets.layout.RowLayout",
          creationSupport.toString());
      // validation
      assertFalse(creationSupport.canReorder());
      assertFalse(creationSupport.canReparent());
      // no clipboard
      assertNull(creationSupport.getImplicitClipboard());
    }
    // check variable
    {
      ImplicitLayoutVariableSupport variableSupport =
          (ImplicitLayoutVariableSupport) layout.getVariableSupport();
      assertTrue(variableSupport.isDefault());
      assertEquals("implicit-layout", variableSupport.toString());
      assertEquals("(implicit layout)", variableSupport.getTitle());
      // name
      assertFalse(variableSupport.hasName());
      try {
        variableSupport.getName();
        fail();
      } catch (IllegalStateException e) {
      }
      try {
        variableSupport.setName("foo");
        fail();
      } catch (IllegalStateException e) {
      }
      // conversion
      assertFalse(variableSupport.canConvertLocalToField());
      try {
        variableSupport.convertLocalToField();
        fail();
      } catch (IllegalStateException e) {
      }
      assertFalse(variableSupport.canConvertFieldToLocal());
      try {
        variableSupport.convertFieldToLocal();
        fail();
      } catch (IllegalStateException e) {
      }
    }
    // check association
    assertInstanceOf(ImplicitObjectAssociation.class, layout.getAssociation());
  }
View Full Code Here

            "// filler filler filler",
            "public class Test extends RowPanel {",
            "  public Test() {",
            "  }",
            "}");
    LayoutInfo layout = panel.getLayout();
    assertInstanceOf(ImplicitLayoutCreationSupport.class, layout.getCreationSupport());
    // materialize by asking for expression
    {
      NodeTarget target = getNodeBlockTarget(panel, false);
      String accessExpression = layout.getVariableSupport().getAccessExpression(target);
      assertEquals("rowLayout.", accessExpression);
    }
    // check creation/variable/association
    assertInstanceOf(ImplicitLayoutCreationSupport.class, layout.getCreationSupport());
    assertInstanceOf(LocalUniqueVariableSupport.class, layout.getVariableSupport());
    assertInstanceOf(ImplicitObjectAssociation.class, layout.getAssociation());
    // check source
    assertEditor(
        "// filler filler filler",
        "public class Test extends RowPanel {",
        "  public Test() {",
View Full Code Here

            "    RowLayout rowLayout = (RowLayout) getLayout();",
            "  }",
            "}");
    // initial state
    {
      LayoutInfo layout = panel.getLayout();
      {
        CreationSupport creationSupport = layout.getCreationSupport();
        assertInstanceOf(ImplicitLayoutCreationSupport.class, creationSupport);
        assertTrue(creationSupport.canDelete());
      }
      {
        VariableSupport variableSupport = layout.getVariableSupport();
        assertInstanceOf(LocalUniqueVariableSupport.class, variableSupport);
        assertEquals("rowLayout", variableSupport.getName());
      }
      assertInstanceOf(ImplicitObjectAssociation.class, layout.getAssociation());
    }
    // check for "de-materializing" implicit layout
    {
      panel.getLayout().delete();
      assertEditor(
          "import com.gwtext.client.widgets.layout.RowLayout;",
          "public class Test extends RowPanel {",
          "  public Test() {",
          "  }",
          "}");
      // still implicit layout
      LayoutInfo layout = panel.getLayout();
      assertInstanceOf(ImplicitLayoutCreationSupport.class, layout.getCreationSupport());
      assertInstanceOf(ImplicitLayoutVariableSupport.class, layout.getVariableSupport());
      assertInstanceOf(ImplicitObjectAssociation.class, layout.getAssociation());
      assertEquals(
          "implicit-layout: com.gwtext.client.widgets.layout.RowLayout",
          layout.getCreationSupport().toString());
    }
  }
View Full Code Here

    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {}",
        "  {implicit-layout: default} {implicit-layout} {}");
    // set RowLayout
    {
      LayoutInfo layout = createJavaInfo("com.gwtext.client.widgets.layout.RowLayout");
      panel.setLayout(layout);
      assertEditor(
          "// filler filler filler",
          "public class Test extends Panel {",
          "  public Test() {",
          "    setLayout(new RowLayout());",
          "  }",
          "}");
      assertHierarchy(
          "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/}",
          "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}");
      assertSame(layout, panel.getLayout());
    }
    // set ColumnLayout
    {
      LayoutInfo layout = createJavaInfo("com.gwtext.client.widgets.layout.ColumnLayout");
      panel.setLayout(layout);
      assertEditor(
          "// filler filler filler",
          "public class Test extends Panel {",
          "  public Test() {",
View Full Code Here

    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/add(new com.google.gwt.user.client.ui.Button())/}",
        "  {implicit-layout: default} {implicit-layout} {}",
        "  {new: com.google.gwt.user.client.ui.Button} {empty} {/add(new com.google.gwt.user.client.ui.Button())/}");
    // set RowLayout
    LayoutInfo layout = createJavaInfo("com.gwtext.client.widgets.layout.RowLayout");
    assertSame(ComponentOrderFirst.INSTANCE, layout.getDescription().getOrder());
    panel.setLayout(layout);
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new RowLayout());",
View Full Code Here

            "  }",
            "}");
    panel.refresh();
    // set AbsoluteLayout
    {
      LayoutInfo layout = createJavaInfo("com.gwtext.client.widgets.layout.AbsoluteLayout");
      panel.setLayout(layout);
    }
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
View Full Code Here

            "  }",
            "}");
    panel.refresh();
    // set RowLayout
    {
      LayoutInfo layout = createJavaInfo("com.gwtext.client.widgets.layout.RowLayout");
      panel.setLayout(layout);
    }
    assertEditor(
        "public class Test extends Panel {",
        "  public Test() {",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.gwtext.model.layout.LayoutInfo

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.