/*******************************************************************************
 * Copyright (c) 2014 Dennis Melzer and others.
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 * Dennis - initial API and implementation
 ******************************************************************************/
package makeithappen.vaadin.custom.control;

import org.eclipse.emf.ecp.view.core.vaadin.AbstractControlRendererVaadin;
import org.eclipse.emf.ecp.view.core.vaadin.VaadinRendererUtil;
import org.eclipse.emf.ecp.view.spi.custom.model.VCustomControl;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;

import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Upload;

public class UploadCustomComponent extends AbstractControlRendererVaadin<VCustomControl> {

	private Label label;

	@Override
	protected Component render() {
		HorizontalLayout horizontalLayout = new HorizontalLayout();
		this.label = new Label();
		horizontalLayout.addComponent(this.label);
		Upload upload = new Upload();
		horizontalLayout.addComponent(upload);
		return horizontalLayout;
	}

	@Override
	protected void applyCaption() {
		final IItemPropertyDescriptor itemPropertyDescriptor = VaadinRendererUtil
				.getItemPropertyDescriptor(getVElement().getDomainModelReference().getIterator().next());
		this.label.setCaption(itemPropertyDescriptor.getDisplayName(null));
	}
}

@@ -566,83 +566,8 @@
 l;%0A%0A
-import org.eclipse.emf.ecp.view.core.vaadin.AbstractControlRendererVaadin;%0A
 impo
@@ -662,26 +662,22 @@
 iew.
-spi.
 custom.
-model.V
+vaadin.
 Cust
@@ -685,16 +685,30 @@
 mControl
+VaadinRenderer
 ;%0Aimport
@@ -940,53 +940,35 @@
 nds 
-AbstractControlRendererVaadin%3CVCustomControl%3E
+CustomControlVaadinRenderer
  %7B%0A%0A

Change Renderer