package org.lunifera.runtime.web.vaadin.components.fields.client;

import com.vaadin.client.StyleConstants;
import com.vaadin.client.ui.VCustomComponent;

public class VEntityField extends VCustomComponent {

	public static final String CLASSNAME = "l-entityfield";

	public VEntityField() {
		super();
		setStyleName(CLASSNAME);
		addStyleName(StyleConstants.UI_LAYOUT);
	}

}

@@ -75,301 +75,1838 @@
 com.
-vaadin.client.StyleConstants;%0Aimport com.vaadin.client.ui.VCustomComponent;%0A%0Apublic class VEntityField extends VCustomComponent %7B%0A%0A%09public static final String CLASSNAME = %22l-entityfield%22;%0A%0A%09public VEntityField() %7B%0A%09%09super();%0A%09%09setStyleName(CLASSNAME);%0A%09%09addStyleName(StyleConstants.UI_LAYOUT);
+google.gwt.event.dom.client.BlurEvent;%0Aimport com.google.gwt.event.dom.client.BlurHandler;%0Aimport com.google.gwt.event.dom.client.ChangeEvent;%0Aimport com.google.gwt.event.dom.client.ChangeHandler;%0Aimport com.google.gwt.event.dom.client.FocusEvent;%0Aimport com.google.gwt.event.dom.client.FocusHandler;%0Aimport com.google.gwt.event.dom.client.KeyDownEvent;%0Aimport com.google.gwt.event.dom.client.KeyDownHandler;%0Aimport com.google.gwt.event.dom.client.MouseUpHandler;%0Aimport com.google.gwt.event.shared.HandlerRegistration;%0Aimport com.google.gwt.user.client.ui.Widget;%0Aimport com.vaadin.client.StyleConstants;%0Aimport com.vaadin.client.ui.Field;%0Aimport com.vaadin.client.ui.VCustomComponent;%0Aimport com.vaadin.client.ui.VLink;%0Aimport com.vaadin.client.ui.VTextField;%0A%0Apublic class VEntityField extends VCustomComponent implements Field,%0A%09%09ChangeHandler, FocusHandler, BlurHandler, KeyDownHandler,%0A%09%09MouseUpHandler %7B%0A%0A%09public static final String CLASSNAME = %22l-entityfield%22;%0A%0A%09private VTextField textField;%0A%09private VLink link;%0A%09private Widget activeField;%0A%0A%09private HandlerRegistration mouseUpHandler;%0A%0A%09public VEntityField() %7B%0A%09%09super();%0A%09%09setStyleName(CLASSNAME);%0A%09%09addStyleName(StyleConstants.UI_LAYOUT);%0A%0A%09%09setEditable(true);%0A%09%7D%0A%0A%09private void setEditable(boolean editable) %7B%0A%09%09if (editable) %7B%0A%0A%09%09%09link.removeFromParent();%0A%09%09%09textField.addChangeHandler(this);%0A%09%09%09textField.addFocusHandler(this);%0A%09%09%09textField.addBlurHandler(this);%0A%09%09%09textField.addKeyDownHandler(this);%0A%09%09%09add(textField);%0A%09%09%7D else %7B%0A%09%09%09mouseUpHandler = link.addMouseUpHandler(this);%0A%09%09%09textField.removeFromParent();%0A%09%09%09add(link);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public void onKeyDown(KeyDownEvent event) %7B%0A%0A%09%7D%0A%0A%09@Override%0A%09public void onBlur(BlurEvent event) %7B%0A%0A%09%7D%0A%0A%09@Override%0A%09public void onFocus(FocusEvent event) %7B%0A%0A%09%7D%0A%0A%09@Override%0A%09public void onChange(ChangeEvent event) %7B%0A
 %0A%09%7D%0A

work in progress -> Client widget