package org.jboss.seam.ui.component.html;
import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import org.jboss.seam.ui.component.UIRemote;
public class HtmlRemote extends UIRemote{
final static public String COMPONENT_FAMILY = "org.jboss.seam.ui.Remote";
final static public String COMPONENT_TYPE = "org.jboss.seam.ui.Remote";
/*
* The Seam components to include in the Seam Remoting JS interface stubs
*/
private String _include = null;
/*
* CSS style rules to be applied to the component
*/
private String _style = null;
/*
* Assigns one or more CSS class names to the component. Corresponds to the HTML "class" attribute.
*/
private String _styleClass = null;
public HtmlRemote(){
setRendererType("org.jboss.seam.ui.RemoteRenderer");
}
public String getInclude(){
if (this._include != null) {
return this._include;
}
ValueExpression ve = getValueExpression("include");
if (ve != null) {
String value = null;
try {
value = (String) ve.getValue(getFacesContext().getELContext());
} catch (ELException e) {
throw new FacesException(e);
}
return value;
}
return null;
}
public void setInclude(String _include){
this._include = _include;
}
public String getStyle(){
if (this._style != null) {
return this._style;
}
ValueExpression ve = getValueExpression("style");
if (ve != null) {
String value = null;
try {
value = (String) ve.getValue(getFacesContext().getELContext());
} catch (ELException e) {
throw new FacesException(e);
}
return value;
}
return null;
}
public void setStyle(String _style){
this._style = _style;
}
public String getStyleClass(){
if (this._styleClass != null) {
return this._styleClass;
}
ValueExpression ve = getValueExpression("styleClass");
if (ve != null) {
String value = null;
try {
value = (String) ve.getValue(getFacesContext().getELContext());
} catch (ELException e) {
throw new FacesException(e);
}
return value;
}
return null;
}
public void setStyleClass(String _styleClass){
this._styleClass = _styleClass;
}
public String getFamily(){
return COMPONENT_FAMILY;
}
@Override
public Object saveState(FacesContext context){
Object [] state = new Object[4];
state[0] = super.saveState(context);
state[1] = _include;
state[2] = _style;
state[3] = _styleClass;
return state;
}
@Override
public void restoreState(FacesContext context, Object state){
Object[] states = (Object[]) state;
super.restoreState(context, states[0]);
_include = (String)states[1];;
_style = (String)states[2];;
_styleClass = (String)states[3];;
}
}