All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ajax4jsf.ajax.repeat.RepeatState Maven / Gradle / Ivy

Go to download

Ajax4jsf is an open source extension to the JavaServer Faces standard that adds AJAX capability to JSF applications without requiring the writing of any JavaScript.

The newest version!
/**
 * 
 */
package org.ajax4jsf.ajax.repeat;

import java.io.Serializable;

import javax.faces.context.FacesContext;

/**
 * @author shura
 *
 */
public class RepeatState implements DataComponentState {
	
	private int _rows = -1;
	
	private int _first = 0;
	
	private boolean _transient = true;

	/**
	 * @return the first
	 */
	public int getFirst() {
		return _first;
	}

	/**
	 * @param first the first to set
	 */
	public void setFirst(int first) {
		this._first = first;
	}

	/**
	 * @return the rows
	 */
	public int getRows() {
		return _rows;
	}

	/**
	 * @param rows the rows to set
	 */
	public void setRows(int rows) {
		this._rows = rows;
	}

	/* (non-Javadoc)
	 * @see org.ajax4jsf.ajax.repeat.DataComponentState#getRange()
	 */
	public Range getRange() {
		// TODO Auto-generated method stub
		return new SequenceRange(getFirst(),getRows());
	}

	/* (non-Javadoc)
	 * @see javax.faces.component.StateHolder#isTransient()
	 */
	public boolean isTransient() {
		return this._transient;
	}

	/* (non-Javadoc)
	 * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
	 */
	public void restoreState(FacesContext context, Object state) {
	}

	/* (non-Javadoc)
	 * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
	 */
	public Object saveState(FacesContext context) {
		return null;
	}
	
	private static final class State implements Serializable{
		private int first;
		private int rows;
	}

	/* (non-Javadoc)
	 * @see javax.faces.component.StateHolder#setTransient(boolean)
	 */
	public void setTransient(boolean newTransientValue) {
		this._transient = newTransientValue;

	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy