private double _calculateStep()

in myfaces-html5-core/src/main/java/org/apache/myfaces/html5/renderkit/input/HtmlInputNumberSliderRenderer.java [110:146]


    private double _calculateStep(HtmlInputNumberSlider component, double min, double max)
    {
        double calculatedStep;
        double step = component.getStep();
        int segmentCount = component.getSegmentCount();

        if (step != Double.MIN_VALUE && segmentCount != Integer.MIN_VALUE)
        { // if both are set
            throw new FacesException(
                    "Only one of 'step' or 'segmentCount' properties must be defined for component " + DebugUtils.getPathToComponent(component) + ". Undefined one will be calculated.");
        }

        if (step != Double.MIN_VALUE)
        { // if only step is set
            if (step <= 0)
            { // if it is set but it is negative
                throw new FacesException("'step' property of component " + DebugUtils.getPathToComponent(component) + " must be positive");
            }
            calculatedStep = step;
        }
        else if (segmentCount != Integer.MIN_VALUE)
        { // if only segmentCount is set
            if (segmentCount <= 0)
            { // if it is set but it is negative
                throw new FacesException("'segmentCount' property of component " + DebugUtils.getPathToComponent(
                        component) + " must be positive");
            }
            calculatedStep = (max - min) / segmentCount;
        }
        else
        {
            // both step and segmentCount is not set, use the default value
            calculatedStep = (max - min) / DEFAULT_SEGMENT_COUNT;
        }

        return calculatedStep;
    }