org.butterfaces.component.html.HtmlLabeledContainer Maven / Gradle / Ivy
package org.butterfaces.component.html;
import org.butterfaces.component.base.component.UIComponentBase;
import org.butterfaces.component.html.feature.*;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.FacesComponent;
@ResourceDependencies({
@ResourceDependency(library = "butterfaces-dist-css", name = "butterfaces-default.css", target = "head")
})
@FacesComponent(HtmlLabeledContainer.COMPONENT_TYPE)
public class HtmlLabeledContainer extends UIComponentBase implements Tooltip, Label, HideLabel, StyleClass, Style {
public static final String COMPONENT_TYPE = "org.butterfaces.component.labeledContainer";
public static final String COMPONENT_FAMILY = "org.butterfaces.component.family";
public static final String RENDERER_TYPE = "org.butterfaces.component.renderkit.html_basic.LabeledContainerRenderer";
protected static final String PROPERTY_HIDE_LABEL = "hideLabel";
protected static final String PROPERTY_LABEL = "label";
protected static final String PROPERTY_STYLE_CLASS = "styleClass";
protected static final String PROPERTY_STYLE = "style";
public HtmlLabeledContainer() {
super();
this.setRendererType(RENDERER_TYPE);
}
@Override
public String getFamily() {
return COMPONENT_FAMILY;
}
public boolean isHideLabel() {
final Object eval = this.getStateHelper().eval(PROPERTY_HIDE_LABEL);
return eval == null ? false : (Boolean) eval;
}
public void setHideLabel(final boolean hideLabel) {
this.updateStateHelper(PROPERTY_HIDE_LABEL, hideLabel);
}
@Override
public String getLabel() {
return (String) this.getStateHelper().eval(PROPERTY_LABEL);
}
public void setLabel(String label) {
this.updateStateHelper(PROPERTY_LABEL, label);
}
@Override
public String getStyleClass() {
return (String) this.getStateHelper().eval(PROPERTY_STYLE_CLASS);
}
public void setStyleClass(final String styleClass) {
this.updateStateHelper(PROPERTY_STYLE_CLASS, styleClass);
}
public String getStyle() {
return (String) this.getStateHelper().eval(PROPERTY_STYLE);
}
public void setStyle(final String style) {
this.updateStateHelper(PROPERTY_STYLE, style);
}
}