package combobox;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;

import util.data.Data;

/**
 * @author AYanul
 *
 */
public class Combobox {
	public boolean disabled;
	public String defaultLabel;
	public boolean filterNewValues;
	public String hideDelay;
	public boolean directInputSuggestions;
	public boolean immediate;
	public String inputSize;
	public String width;
	public String value;
	public int tabindex;
	public List<String> suggestionValues;
	public int size;
	public String showDelay;
	public boolean required;
	public String requiredMessage;
	public boolean rendered;
	public boolean selectFirstOnUpdate;
	public int maxlength;
	public boolean enableManualInput;
	public String listHeight;
	public String listWidth;
	public ArrayList<SelectItem> selectItem;

	public Combobox() {
		this.disabled = false;
		this.defaultLabel = "defaultLabel";
		this.filterNewValues = false;
		this.hideDelay = "100";
		this.directInputSuggestions = true;
		this.immediate = false;
		this.inputSize = "4";
		this.width = "300";
		this.value = "";
		this.tabindex = 2;
		this.size = 5;
		this.showDelay = "200";
		this.required = false;
		this.requiredMessage = "requiredMessage";
		this.rendered = true;
		this.selectFirstOnUpdate = true;
		this.maxlength = 5;
		this.enableManualInput = true;
		this.listHeight = "400";
		this.listWidth = "350";
		this.suggestionValues = new ArrayList<String>();
		this.selectItem = new ArrayList<SelectItem>();
		Random r = new Random(); 
		for(int i = 0; i < 10; i++){
			suggestionValues.add("suggestionValues " + r.nextInt(10) + " N=" + i);
			selectItem.add(new SelectItem("selectItem " + r.nextInt(10) + " N=" + i));
		}
	}

	public ArrayList<SelectItem> getSelectItem() {
		return selectItem;
	}

	public void setSelectItem(ArrayList<SelectItem> selectItem) {
		this.selectItem = selectItem;
	}

	public void valueChangeListener(ValueChangeEvent event) {
		System.out.println(event.getNewValue());
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public String getDefaultLabel() {
		return defaultLabel;
	}

	public void setDefaultLabel(String defaultLabel) {
		this.defaultLabel = defaultLabel;
	}

	public String getHideDelay() {
		return hideDelay;
	}

	public void setHideDelay(String hideDelay) {
		this.hideDelay = hideDelay;
	}

	public boolean isDirectInputSuggestions() {
		return directInputSuggestions;
	}

	public void setDirectInputSuggestions(boolean directInputSuggestions) {
		this.directInputSuggestions = directInputSuggestions;
	}

	public boolean isImmediate() {
		return immediate;
	}

	public void setImmediate(boolean immediate) {
		this.immediate = immediate;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public int getTabindex() {
		return tabindex;
	}

	public void setTabindex(int tabindex) {
		this.tabindex = tabindex;
	}

	public List<String> getSuggestionValues() {
		return suggestionValues;
	}

	public void setSuggestionValues(List<String> suggestionValues) {
		this.suggestionValues = suggestionValues;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public boolean isFilterNewValues() {
		return filterNewValues;
	}

	public void setFilterNewValues(boolean filterNewValues) {
		this.filterNewValues = filterNewValues;
	}

	public String getShowDelay() {
		return showDelay;
	}

	public void setShowDelay(String showDelay) {
		this.showDelay = showDelay;
	}

	public boolean isRequired() {
		return required;
	}

	public void setRequired(boolean required) {
		this.required = required;
	}

	public String getRequiredMessage() {
		return requiredMessage;
	}

	public void setRequiredMessage(String requiredMessage) {
		this.requiredMessage = requiredMessage;
	}

	public boolean isRendered() {
		return rendered;
	}

	public void setRendered(boolean rendered) {
		this.rendered = rendered;
	}

	public boolean isSelectFirstOnUpdate() {
		return selectFirstOnUpdate;
	}

	public void setSelectFirstOnUpdate(boolean selectFirstOnUpdate) {
		this.selectFirstOnUpdate = selectFirstOnUpdate;
	}

	public int getMaxlength() {
		return maxlength;
	}

	public void setMaxlength(int maxlength) {
		this.maxlength = maxlength;
	}

	public boolean isEnableManualInput() {
		return enableManualInput;
	}

	public void setEnableManualInput(boolean enableManualInput) {
		this.enableManualInput = enableManualInput;
	}

	public String getListHeight() {
		return listHeight;
	}

	public void setListHeight(String listHeight) {
		this.listHeight = listHeight;
	}

	public String getListWidth() {
		return listWidth;
	}

	public void setListWidth(String listWidth) {
		this.listWidth = listWidth;
	}

	public String getInputSize() {
		return inputSize;
	}

	public void setInputSize(String inputSize) {
		this.inputSize = inputSize;
	}

}
