package org.ajax4jsf.bean;

import javax.faces.event.ActionEvent;

public class A4JPollTestBean {
	
	private Integer i = 1;
	
	private static final String POLLING = "Polling";
	
	private boolean enabled = false;
	
	public void start(ActionEvent event) {
		enabled = true;
	}
	
	public void listener(ActionEvent event) {
		i++;
		if (i == 8) {
			enabled = false;
		}
	}
	
	public String getText() {
		return POLLING.substring(0, i);
	}

	/**
	 * @return the i
	 */
	public Integer getI() {
		return i;
	}

	/**
	 * @param i the i to set
	 */
	public void setI(Integer i) {
		this.i = i;
	}

	/**
	 * @return the enabled
	 */
	public boolean isEnabled() {
		return enabled;
	}

	/**
	 * @param enabled the enabled to set
	 */
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
	
	

}
