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

com.jsftoolkit.base.DataIteratorBase Maven / Gradle / Ivy

Go to download

The core classes for the JSF Toolkit Component Framework. Includes all framework base and utility classes as well as component kick-start/code-generation and registration tools. Also includes some classes for testing that are reused in other projects. They cannot be factored out into a separate project because they are referenced by the tests and they reference this code (circular dependence).

The newest version!
package com.jsftoolkit.base;

import com.jsftoolkit.base.ComponentHelp;
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;

/**
 * **GENERATED SOURCE**
 * You may subclass this class, but should probably not edit it.
 * See the JSF Toolkit homepage for more information.
 */

public abstract class DataIteratorBase extends UIData {

    public static final String ROW_ID = "rowId";

    public static final String REGISTER_RENDERER = "com.jsftoolkit.base.GenericDataRenderer";

    public static final String DEFAULT_RENDERER_TYPE = "com.jsftoolkit.GenericDataRenderer";

    public static final String COMPONENT_FAMILY = "javax.faces.Data";

    public static final String COMPONENT_TYPE = "com.jsftoolkit.DataIterator";

    public DataIteratorBase(){
        setRendererType(DEFAULT_RENDERER_TYPE);
    }

    public String getFamily() {
       return COMPONENT_FAMILY;
    }

    public Object saveState(FacesContext context) {
        Object[] state = new Object[1];
        state[0] = super.saveState(context);
        return state;
    }

    public void restoreState(FacesContext context, Object state) {
        Object[] values = (Object[]) state;
        super.restoreState(context, values[0]);
    }

    protected  T getAttribute(T value, T defaultValue, String attribute) {
        return ComponentHelp.getAttribute(value, defaultValue, attribute, this,
                getFacesContext());
    }

    protected boolean getBooleanAttribute(Boolean value, String attribute) {
         return getAttribute(value, false, attribute);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy