/** Test for {@link LayoutContainerInfo#setLayout(LayoutInfo)} and {@link ComponentOrder}. */ public void test_setLayout_order() throws Exception { LayoutContainerInfo container = parseJavaInfo( "public class Test extends LayoutContainer {", " public Test() {", " add(new Button());", " }", "}"); assertHierarchy( "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {/add(new Button())/}", " {implicit-layout: default} {implicit-layout} {}", " {new: com.extjs.gxt.ui.client.widget.button.Button} {empty} {/add(new Button())/}"); // set RowLayout LayoutInfo layout = createJavaInfo("com.extjs.gxt.ui.client.widget.layout.RowLayout"); assertSame(ComponentOrderFirst.INSTANCE, layout.getDescription().getOrder()); container.setLayout(layout); assertEditor( "public class Test extends LayoutContainer {", " public Test() {", " setLayout(new RowLayout(Orientation.HORIZONTAL));", " add(new Button());", " }", "}"); assertHierarchy( "{this: com.extjs.gxt.ui.client.widget.LayoutContainer} {this} {/add(new Button())/ /setLayout(new RowLayout(Orientation.HORIZONTAL))/}", " {new: com.extjs.gxt.ui.client.widget.layout.RowLayout} {empty} {/setLayout(new RowLayout(Orientation.HORIZONTAL))/}", " {new: com.extjs.gxt.ui.client.widget.button.Button} {empty} {/add(new Button())/}", " {virtual-layout_data: com.extjs.gxt.ui.client.widget.layout.RowData} {virtual-layout-data} {}"); }