All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.bootsfaces.component.ComponentUtils Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package net.bootsfaces.component;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;

import net.bootsfaces.beans.ELTools;

@ManagedBean
@RequestScoped
public class ComponentUtils {
	private boolean renderLabelDefault = true;

	public ComponentUtils() {
		String renderLabel = FacesContext.getCurrentInstance().getExternalContext()
				.getInitParameter("net.bootsfaces.defaults.renderLabel");
		if (null != renderLabel && renderLabel.contains("#{")) {
			renderLabelDefault = (Boolean) ELTools.evalAsObject(renderLabel);
		}
		else if (null != renderLabel) {
			renderLabelDefault = Boolean.valueOf(renderLabel);
		}
	}

	public static boolean isRenderLabelDefault() {
		ComponentUtils cu = (ComponentUtils) ELTools.evalAsObject("#{componentUtils}");
		return cu.renderLabelDefault;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy