*/
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._required != null) {
if (this._required.isLiteralText()) {
try {
Boolean __required = (Boolean) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._required.getExpressionString(),
Boolean.class);
comp.setRequired(__required.booleanValue());
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("required", this._required);
}
}
if (this._requiredMessage != null) {
if (this._requiredMessage.isLiteralText()) {
try {
java.lang.String __requiredMessage = (java.lang.String) getFacesContext().
getApplication().
getExpressionFactory().
coerceToType(this._requiredMessage.getExpressionString(),
java.lang.String.class);
comp.setRequiredMessage(__requiredMessage);
} catch (ELException e) {
throw new FacesException(e);
}
} else {
component.setValueExpression("requiredMessage", this._requiredMessage);
}
}
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);