/**
 * 
 */
package org.richfaces.demo.pickList;

import java.util.ArrayList;

import javax.faces.model.SelectItem;

/**
 * @author Ilya Shaikovsky
 *
 */
public class PickListBean {
	
	private ArrayList<String> result;

	private SelectItem[] optionsAvailable;
	
	public SelectItem[] getOptionsAvailable() {
		return optionsAvailable;
	}

	public void setOptionsAvailable(SelectItem[] optionsAvailable) {
		this.optionsAvailable = optionsAvailable;
	}

	public PickListBean() {
		optionsAvailable = new SelectItem[5];
		for (int i = 0; i < optionsAvailable.length; i++) {
			optionsAvailable[i] = new SelectItem();
			optionsAvailable[i].setLabel("Generated Option " + i);
			optionsAvailable[i].setValue("Value " + i);
		}
	}

	public ArrayList<String> getResult() {
		return result;
	}

	public void setResult(ArrayList<String> result) {
		this.result = result;
	}

	public Integer getItems() {
		if (result == null){
			return 0;
		}
		return result.size();
	}
}
