<commit_before>package br.com.dbsoft.ui.component.slider;

import java.io.IOException;
import java.util.List;

import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.FacesRenderer;

import com.google.gson.Gson;

import br.com.dbsoft.ui.component.DBSRenderer;
import br.com.dbsoft.ui.component.slider.DBSSlider;
import br.com.dbsoft.ui.component.slider.DBSSlider.CONTENT_ALIGNMENT;
import br.com.dbsoft.ui.component.slider.DBSSlider.ORIENTATION;
import br.com.dbsoft.ui.component.slider.DBSSlider.TYPE;
import br.com.dbsoft.ui.core.DBSFaces;
import br.com.dbsoft.ui.core.DBSFaces.CSS;
import br.com.dbsoft.util.DBSFormat;
import br.com.dbsoft.util.DBSNumber;
import br.com.dbsoft.util.DBSObject;

@FacesRenderer(componentFamily=DBSFaces.FAMILY, rendererType=DBSSlider.RENDERER_TYPE)
public class DBSSliderRenderer extends DBSRenderer {
    
	@Override
	public void decode(FacesContext pContext, UIComponent pComponent) {
		DBSSlider xSlider = (DBSSlider) pComponent;
        if(xSlider.getReadOnly()) {return;}
        
        decodeBehaviors(pContext, xSlider);
        
		TYPE xType = TYPE.get(xSlider.getType());
		Object xValue;
		ValueExpression xVE;
		if (xType == TYPE.RANGE){
			xValue = DBSFaces.getDecodedComponenteValue(pContext, pvGetInputClientId(xSlider) + "_begin");
	        if (xValue != null){
			 	xVE =  pComponent.getValueExpression("beginValue");
			 	xVE.setValue(pContext.getELContext(), DBSNumber.toDouble(xValue));
	        }
			xValue = DBSFaces.getDecodedComponenteValue(pContext, pvGetInputClientId(xSlider) + "_end");
	        if (xValue != null){
			 	xVE =  pComponent.getValueExpression("endValue");
			 	xVE.setValue(pContext.getELContext(), DBSNumber.toDouble(xValue));
	        }
        	xSlider.setSubmittedValue(null);
		}else{
			xValue = DBSFaces.getDecodedComponenteValue(pContext, pvGetInputClientId(xSlider));
	        if (xValue != null){
	        	xSlider.setSubmittedValue(xValue);
	        }
		}
//		String xClientIdAction = getInputDataClientId(xInputNumber);<commit_msg>Testa VE null<commit_after>package br.com.dbsoft.ui.component.slider;

import java.io.IOException;
import java.util.List;

import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.FacesRenderer;

import com.google.gson.Gson;

import br.com.dbsoft.ui.component.DBSRenderer;
import br.com.dbsoft.ui.component.slider.DBSSlider;
import br.com.dbsoft.ui.component.slider.DBSSlider.CONTENT_ALIGNMENT;
import br.com.dbsoft.ui.component.slider.DBSSlider.ORIENTATION;
import br.com.dbsoft.ui.component.slider.DBSSlider.TYPE;
import br.com.dbsoft.ui.core.DBSFaces;
import br.com.dbsoft.ui.core.DBSFaces.CSS;
import br.com.dbsoft.util.DBSFormat;
import br.com.dbsoft.util.DBSNumber;
import br.com.dbsoft.util.DBSObject;

@FacesRenderer(componentFamily=DBSFaces.FAMILY, rendererType=DBSSlider.RENDERER_TYPE)
public class DBSSliderRenderer extends DBSRenderer {
    
	@Override
	public void decode(FacesContext pContext, UIComponent pComponent) {
		DBSSlider xSlider = (DBSSlider) pComponent;
        if(xSlider.getReadOnly()) {return;}
        
        decodeBehaviors(pContext, xSlider);
        
		TYPE xType = TYPE.get(xSlider.getType());
		Object xValue;
		ValueExpression xVE;
		if (xType == TYPE.RANGE){
			xValue = DBSFaces.getDecodedComponenteValue(pContext, pvGetInputClientId(xSlider) + "_begin");
	        if (xValue != null){
			 	xVE =  pComponent.getValueExpression("beginValue");
			 	if (xVE != null){
			 		xVE.setValue(pContext.getELContext(), DBSNumber.toDouble(xValue));
			 	}
	        }
			xValue = DBSFaces.getDecodedComponenteValue(pContext, pvGetInputClientId(xSlider) + "_end");
	        if (xValue != null){
			 	xVE =  pComponent.getValueExpression("endValue");
			 	if (xVE != null){
			 		xVE.setValue(pContext.getELContext(), DBSNumber.toDouble(xValue));
			 	}
	        }
        	xSlider.setSubmittedValue(null);
		}else{
			xValue = DBSFaces.getDecodedComponenteValue(pContext, pvGetInputClientId(xSlider));
	        if (xValue != null){
	        	xSlider.setSubmittedValue(xValue);
	        }
		}
//		String xClientIdAction = getInputDataClientId(xInputNumber);
{'fraction_non_alphanumeric': 0.11737734983952315, 'fraction_numerical': 0.0, 'mean_word_length': 4.340269277845778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1695414', 'n_tokens_mistral': 1569, 'n_tokens_neox': 1525, 'n_words': 215}