package eu.dnetlib.enabling.ui.common.widgets;

import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;




public abstract class TextBoxWithLabel<T> extends TextBox implements WithLabel, MyFormComponent<T> {
	private Label label;
	private String name;
	private int position;

	public TextBoxWithLabel(String name, int position) {
		super();
		this.label = new Label(name);
		this.name = name;
		this.position = position;
	}

	@Override
	public Label getLabel() {
		return label;
	}

	@Override
	public void setTextLabel(String text) {
		label.setText(text);
	}

	@Override
	abstract public T getFieldValue();

	@Override
	public String getFieldName() {
		return name;
	}

	@Override
	public int getPosition() {
		return position;
	}

}
