Examples of CounterFormatter


Examples of com.volantis.styling.impl.functions.counter.CounterFormatter

     *
     * @throws Exception
     */
    public void testReturnsStyleInteger() throws Exception {

        CounterFormatter formatter = new DecimalFormatter();
        StyleValue result = formatter.formatAsStyleValue(
                ListStyleTypeKeywords.DECIMAL, 4);
        assertTrue("Must be StyleInteger", result instanceof StyleInteger);
    }
View Full Code Here

Examples of com.volantis.styling.impl.functions.counter.CounterFormatter

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        CounterFormatterSelector selector =
                new AlphabeticFormatterSelector(formatterMock);
        CounterFormatter formatter;

        // Test zero.
        formatter = selector.selectFormatter(ListStyleTypeKeywords.LOWER_ALPHA,
                0);
        assertSame(DecimalFormatter.getDefaultInstance(), formatter);
View Full Code Here

Examples of com.volantis.styling.impl.functions.counter.CounterFormatter

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        CounterFormatterSelector selector =
                new AlphabeticFormatterSelector(formatterMock);
        CounterFormatter formatter;

        // Test 1.
        formatter = selector.selectFormatter(ListStyleTypeKeywords.LOWER_ALPHA,
                1);
        assertSame(formatterMock, formatter);
View Full Code Here

Examples of com.volantis.styling.impl.functions.counter.CounterFormatter

        for (int i = 0; i < counterValues.length; i++) {
            // TODO later support non-decimal list styles
            int counterValue = counterValues[i];

            CounterFormatter formatter = formatterSelector.selectFormatter(
                    formatStyle, counterValue);

            String value = formatter.formatAsString(formatStyle, counterValue);
            valuesString.append(value);
            if (i < (counterValues.length - 1)) {
                valuesString.append(separator);
            }
        }
View Full Code Here

Examples of com.volantis.styling.impl.functions.counter.CounterFormatter

                    ALLOWABLE_FORMAT_STYLES);
        }

        int counterValue = context.getCounterValue(counterName);

        CounterFormatter formatter = formatterSelector.selectFormatter(
                formatStyle, counterValue);

        StyleValue result = formatter.formatAsStyleValue(formatStyle, counterValue);

        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.