/*
* xulfaces : bring XUL power to Java
*
* Copyright (C) 2005 Olivier SCHMITT
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.xulfaces.component.bridge;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import org.xulfaces.annotation.faces.ATTRIBUTE;
import org.xulfaces.annotation.faces.COMPONENT;
import org.xulfaces.renderkit.KitConstants;
/**
*
* @author kito31
* @version $Id: BridgeComponent.java,v 1.2 2006/06/23 21:34:59 kito31 Exp $
*/
@COMPONENT(type="xul.component.Bridge")
public class BridgeComponent extends UIComponentBase {
@ATTRIBUTE(description="Display debug informations")
private Boolean debug;
@ATTRIBUTE(description="The Javascript file for the bridge")
private String js;
public String getFamily() {
return KitConstants.FAMILY;
}
public String getRenderKitId() {
return KitConstants.RENDERKIT_ID;
}
// @StartGeneration
public java.lang.Boolean getDebug(){
java.lang.Boolean value = null;
ValueBinding vb = getValueBinding("debug");
if (vb != null) {
return (java.lang.Boolean)(vb.getValue(getFacesContext()));
}
else {
value = this.debug;
}
return value;
}
public void setDebug(java.lang.Boolean value){
this.debug = value;
}
public java.lang.String getJs(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("js");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.js;
}
return value;
}
public void setJs(java.lang.String value){
this.js = value;
}
public Object saveState(FacesContext context) {
Object values[] = new Object[3];
values[0] = super.saveState(context);
values[1] = this.debug;
values[2] = this.js;
return ((Object) (values));
}
public void restoreState(FacesContext context, Object state) {
Object values[] = (Object[]) state;
super.restoreState(context, values[0]);
this.debug = (java.lang.Boolean) values[1];
this.js = (java.lang.String) values[2];
}
// @EndGeneration
}