/**
* GENERATED FILE - DO NOT EDIT
*
*/
package org.richfaces.taglib;
import java.lang.String ;
import javax.faces.convert.Converter ;
import java.lang.Object ;
import org.ajax4jsf.webapp.taglib.HtmlComponentTagBase ;
import javax.faces.el.MethodBinding ;
import javax.faces.component.UIComponent ;
import javax.el.ELException;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.el.MethodExpression;
import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
import javax.el.ValueExpression;
import org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor;
import org.richfaces.webapp.taglib.ValueBindingValueExpressionAdaptor;
import org.richfaces.component.html.HtmlTogglePanel;
public class TogglePanelTag extends org.ajax4jsf.webapp.taglib.HtmlComponentTagBase {
// Fields
/*
* converter
* Id of Converter to be used or reference to a Converter
*/
private ValueExpression _converter;
/**
* Id of Converter to be used or reference to a Converter
* Setter for converter
* @param converter - new value
*/
public void setConverter( ValueExpression __converter ){
this._converter = __converter;
}
/*
* converterMessage
* A ValueExpression enabled attribute that, if present,
will be used as the text of the converter message,
replacing any message that comes from the converter
*/
private ValueExpression _converterMessage;
/**
* A ValueExpression enabled attribute that, if present,
will be used as the text of the converter message,
replacing any message that comes from the converter
* Setter for converterMessage
* @param converterMessage - new value
*/
public void setConverterMessage( ValueExpression __converterMessage ){
this._converterMessage = __converterMessage;
}
/*
* immediate
* A flag indicating that this component value must be converted
and validated immediately (that is, during Apply Request Values
phase), rather than waiting until a Process Validations phase
*/
private ValueExpression _immediate;
/**
* A flag indicating that this component value must be converted
and validated immediately (that is, during Apply Request Values
phase), rather than waiting until a Process Validations phase
* Setter for immediate
* @param immediate - new value
*/
public void setImmediate( ValueExpression __immediate ){
this._immediate = __immediate;
}
/*
* initialState
* It contains a name of the first active facet
*/
private ValueExpression _initialState;
/**
* It contains a name of the first active facet
* Setter for initialState
* @param initialState - new value
*/
public void setInitialState( ValueExpression __initialState ){
this._initialState = __initialState;
}
/*
* label
* A localized user presentable name for this component.
*/
private ValueExpression _label;
/**
* A localized user presentable name for this component.
* Setter for label
* @param label - new value
*/
public void setLabel( ValueExpression __label ){
this._label = __label;
}
/*
* stateOrder
* Names of the facets in the switching order. If
ToggleControl doesn't contain information about a next facet to
be shown it is switched corresponding to this
attribute
*/
private ValueExpression _stateOrder;
/**
* Names of the facets in the switching order. If
ToggleControl doesn't contain information about a next facet to
be shown it is switched corresponding to this
attribute
* Setter for stateOrder
* @param stateOrder - new value
*/
public void setStateOrder( ValueExpression __stateOrder ){
this._stateOrder = __stateOrder;
}
/*
* switchType
* Facets switch mode: "client", "server"(default), "ajax".
*/
private ValueExpression _switchType;
/**
* Facets switch mode: "client", "server"(default), "ajax".
* Setter for switchType
* @param switchType - new value
*/
public void setSwitchType( ValueExpression __switchType ){
this._switchType = __switchType;
}
/*
* validator
* MethodBinding pointing at a method that is called during
Process Validations phase of the request processing lifecycle,
to validate the current value of this component
*/
private MethodExpression _validator;
/**
* MethodBinding pointing at a method that is called during
Process Validations phase of the request processing lifecycle,
to validate the current value of this component
* Setter for validator
* @param validator - new value
*/
public void setValidator( MethodExpression __validator ){
this._validator = __validator;
}
/*
* validatorMessage
* A ValueExpression enabled attribute that, if present,
will be used as the text of the validator message,
replacing any message that comes from the validator
*/
private ValueExpression _validatorMessage;
/**
* A ValueExpression enabled attribute that, if present,
will be used as the text of the validator message,
replacing any message that comes from the validator
* Setter for validatorMessage
* @param validatorMessage - new value
*/
public void setValidatorMessage( ValueExpression __validatorMessage ){
this._validatorMessage = __validatorMessage;
}
/*
* value
* The initial value to set when rendered for the first time.
It contains information about an active facet
*/
private ValueExpression _value;
/**
* The initial value to set when rendered for the first time.
It contains information about an active facet
* Setter for value
* @param value - new value
*/
public void setValue( ValueExpression __value ){
this._value = __value;
}
/*
* valueChangeListener
* Listener for value changes
*/
private MethodExpression _valueChangeListener;
/**
* Listener for value changes
* Setter for valueChangeListener
* @param valueChangeListener - new value
*/
public void setValueChangeListener( MethodExpression __valueChangeListener ){
this._valueChangeListener = __valueChangeListener;
}
public void release()
{
// TODO Auto-generated method stub
super.release();
this._converter = null;
this._converterMessage = null;
this._immediate = null;
this._initialState = null;
this._label = null;
this._stateOrder = null;
this._switchType = null;
this._validator = null;
this._validatorMessage = null;
this._value = null;
this._valueChangeListener = null;
}
/* (non-Javadoc)
* @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
// TODO Auto-generated method stub
super.setProperties(component);
HtmlTogglePanel comp = (HtmlTogglePanel) component;
setConverterProperty(comp, this._converter);
if (this._converterMessage != null) {
if (this._converterMessage.isLiteralText()) {
try {
java.lang.String __converterMessage = (java.lang.String) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._converterMessage.getExpressionString(),
java.lang.String.class);
comp.setConverterMessage(__converterMessage);
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("converterMessage", this._converterMessage);
}
}
if (this._immediate != null) {
if (this._immediate.isLiteralText()) {
try {
Boolean __immediate = (Boolean) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._immediate.getExpressionString(),
Boolean.class);
comp.setImmediate(__immediate.booleanValue());
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("immediate", this._immediate);
}
}
if (this._initialState != null) {
if (this._initialState.isLiteralText()) {
try {
java.lang.String __initialState = (java.lang.String) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._initialState.getExpressionString(),
java.lang.String.class);
comp.setInitialState(__initialState);
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("initialState", this._initialState);
}
}
if (this._label != null) {
if (this._label.isLiteralText()) {
try {
java.lang.String __label = (java.lang.String) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._label.getExpressionString(),
java.lang.String.class);
comp.setLabel(__label);
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("label", this._label);
}
}
if (this._stateOrder != null) {
if (this._stateOrder.isLiteralText()) {
try {
java.lang.String __stateOrder = (java.lang.String) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._stateOrder.getExpressionString(),
java.lang.String.class);
comp.setStateOrder(__stateOrder);
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("stateOrder", this._stateOrder);
}
}
if (this._switchType != null) {
if (this._switchType.isLiteralText()) {
try {
java.lang.String __switchType = (java.lang.String) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._switchType.getExpressionString(),
java.lang.String.class);
comp.setSwitchType(__switchType);
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("switchType", this._switchType);
}
}
setValidatorProperty(comp, this._validator);
if (this._validatorMessage != null) {
if (this._validatorMessage.isLiteralText()) {
try {
java.lang.String __validatorMessage = (java.lang.String) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._validatorMessage.getExpressionString(),
java.lang.String.class);
comp.setValidatorMessage(__validatorMessage);
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("validatorMessage", this._validatorMessage);
}
}
if(null != this._value && this._value.isLiteralText()){
throw new IllegalArgumentException("Component org.richfaces.TogglePanel with Id " + component.getClientId(getFacesContext()) +" allows only EL expressions for property value");
}
if (this._value != null) {
if (this._value.isLiteralText()) {
try {
java.lang.Object __value = (java.lang.Object) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._value.getExpressionString(),
java.lang.Object.class);
comp.setValue(__value);
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("value", this._value);
}
}
setValueChangeListenerProperty(comp, this._valueChangeListener);
}
/* (non-Javadoc)
* @see javax.faces.webapp.UIComponentTag#getComponentType()
*/
public String getComponentType() {
// TODO Auto-generated method stub
return "org.richfaces.TogglePanel";
}
/* (non-Javadoc)
* @see javax.faces.webapp.UIComponentTag#getRendererType()
*/
public String getRendererType() {
return "org.richfaces.TogglePanelRenderer";
}
}