/** * Copyright 2014-2017 Riccardo Massera (TheCoder4.Eu), Dario D'Urzo and Stephan Rauh (http://www.beyondjava.net). * * This file is part of BootsFaces. * * BootsFaces 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 3 of the License, or * (at your option) any later version. * * BootsFaces 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 BootsFaces. If not, see <http://www.gnu.org/licenses/>. */ package net.bootsfaces.component.spinner; import javax.el.ValueExpression; import javax.faces.component.FacesComponent; import net.bootsfaces.C; import net.bootsfaces.listeners.AddResourcesListener; import net.bootsfaces.render.Tooltip; import net.bootsfaces.utils.BsfUtils; /** This class holds the attributes of <b:spinner />. */ @FacesComponent(Spinner.COMPONENT_TYPE) public class Spinner extends SpinnerCore implements net.bootsfaces.render.IHasTooltip, net.bootsfaces.render.IResponsive { public static final String COMPONENT_TYPE = C.BSFCOMPONENT + ".spinner.Spinner"; public static final String COMPONENT_FAMILY = C.BSFCOMPONENT; public static final String DEFAULT_RENDERER = "net.bootsfaces.component.spinner.Spinner"; public Spinner() { Tooltip.addResourceFiles(); setSpin(true); AddResourcesListener.addThemedCSSResource("core.css"); //AddResourcesListener.addThemedCSSResource("bsf.css"); setRendererType(DEFAULT_RENDERER); } public String getFamily() { return COMPONENT_FAMILY; } /** * Manage EL-expression for snake-case attributes */ public void setValueExpression(String name, ValueExpression binding) { name = BsfUtils.snakeCaseToCamelCase(name); super.setValueExpression(name, binding); } }