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

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

 

public class CheckBoxWithLabel extends CheckBox implements WithLabel, MyFormComponent<Boolean> {

	private Label label;
	private String name;
	private int position;
	
	public CheckBoxWithLabel(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
	public String getFieldName() {
		return name;
	}

	@Override
	public Boolean getFieldValue() {
		return getValue();
	}

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

}
