package com.xaadin.elementfactory;

import com.vaadin.ui.AbstractComponentContainer;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
import com.xaadin.VisualTreeNode;

public abstract class AbstractDefaultLayoutElementFactory extends AbstractDefaultElementFactory {

	public void addComponentToParent(VisualTreeNode parent, VisualTreeNode child) throws ElementFactoryException {
		if (parent.getComponent() instanceof AbstractComponentContainer) {
			Component childComponent = child.getComponent();
			AbstractComponentContainer parentContainer = parent.getComponent();
			parentContainer.addComponent(childComponent);

			// TODO alignment
			if (parentContainer instanceof AbstractOrderedLayout)
				((AbstractOrderedLayout) parentContainer).setComponentAlignment(childComponent, Alignment.MIDDLE_LEFT);

		}
	}

}

@@ -678,29 +678,8 @@
 );%0A%0A
-%09%09%09// TODO alignment%0A
 %09%09%09i
@@ -730,16 +730,130 @@
 dLayout)
+ %7B%0A                Alignment alignment = parseAlignment(child.getAdditionalParameter(%22alignment%22, %22MIDDLE_LEFT%22));
 %0A%09%09%09%09((A
@@ -929,25 +929,25 @@
 ponent, 
-A
+a
 lignment
 .MIDDLE_
@@ -942,23 +942,24 @@
 ment
-.MIDDLE_LEFT);%0A
+);%0A            %7D
 %0A%09%09%7D

Add alignment to AbstractDefaultLayoutElementFactory