private void initialize_createImplicitLayout() throws Exception {
if (hasLayout()) {
AstEditor editor = getEditor();
Object layout = ReflectionUtils.invokeMethod(getObject(), "getLayout()");
// create implicit layout model
LayoutInfo implicitLayout;
CreationSupport creationSupport = new ImplicitLayoutCreationSupport(this);
if (layout == null) {
implicitLayout = createDefaultImplicitLayout(creationSupport);
} else {
implicitLayout =
(LayoutInfo) JavaInfoUtils.createJavaInfo(editor, layout.getClass(), creationSupport);
}
// initialize layout model
{
// set variable support
{
VariableSupport variableSupport = new ImplicitLayoutVariableSupport(implicitLayout);
implicitLayout.setVariableSupport(variableSupport);
}
// set association
implicitLayout.setAssociation(new ImplicitObjectAssociation(this));
// add as child
addChild(implicitLayout);
}
}
}