/*
* 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.tag.output;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import org.xulfaces.annotation.taglib.ATTRIBUTE;
import org.xulfaces.annotation.taglib.TAG;
import org.xulfaces.tag.XULComponentTag;
/**
*
* @author kito31
* @version $Id$
*/
@TAG(name = "label",description="Defines a label (see XUL label element).")
public class LabelTag extends XULComponentTag {
@ATTRIBUTE(description = "This should be set to a letter that is used as a shortcut key.")
private String accesskey;
@ATTRIBUTE(description = "This attribute should be set to the id of an element that the label is associated with.")
private String control;
@ATTRIBUTE(description = "If the label of the description is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute.")
private String crop;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "Indicates whether the description is disabled or not.")
private String disabled;
@ATTRIBUTE(description = "The text to be used for the label.")
private String value;
public String getComponentType() {
return "xul.component.Label";
}
public String getRendererType() {
return "xul.renderer.Label";
}
public String getAccesskey() {
return accesskey;
}
public void setAccesskey(String accesskey) {
this.accesskey = accesskey;
}
public String getControl() {
return control;
}
public void setControl(String control) {
this.control = control;
}
public String getCrop() {
return crop;
}
public void setCrop(String crop) {
this.crop = crop;
}
public String getDisabled() {
return disabled;
}
public void setDisabled(String disabled) {
this.disabled = disabled;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
// @StartGeneration
protected void setProperties(UIComponent component) {
super.setProperties(component);
FacesContext facesContext = getFacesContext();
setStringAttribute(facesContext,component,"accesskey",accesskey);
setStringAttribute(facesContext,component,"control",control);
setStringAttribute(facesContext,component,"crop",crop);
setBooleanAttribute(facesContext,component,"disabled",disabled);
setStringAttribute(facesContext,component,"value",value);
}
// @EndGeneration
}