LayoutSourceGenerator (final LwContainer container) { LayoutSourceGenerator generator = ourComponentLayoutCodeGenerators.get(container.getClass()); if (generator != null) { return generator; } LwContainer parent = container; while(parent != null) { final String layoutManager = parent.getLayoutManager(); if (layoutManager != null && layoutManager.length() > 0) { generator = ourContainerLayoutCodeGenerators.get(layoutManager); if (generator != null) { return generator; } } parent = parent.getParent(); } return GridLayoutSourceGenerator.INSTANCE; }