/**
* Test for parsing materialized implicit layout (with {@link CastExpression}).
*/
public void test_implicitLayout_3() throws Exception {
prepareRowPanel();
ContainerInfo panel =
parseJavaInfo(
"import com.gwtext.client.widgets.layout.RowLayout;",
"public class Test extends RowPanel {",
" public Test() {",
" 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",